Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

71%
+3 −0
Q&A All numbers are triangular modulo $N$ iff $N$ is a power of $2$?

1 answer  ·  posted 7mo ago by celtschk‭  ·  last activity 6mo ago by Peter Taylor‭

#2: Post edited by user avatar celtschk‭ · 2024-06-09T18:49:28Z (7 months ago)
Fixed some errors
  • When thinking about binary representations of triangular numbers, I noticed an interesting property:
  • In the cases I've tested, for the numbers from $0$ to $2^{n-1}$, each combination of the last $n$ bits occurs exactly once, that is, $k\mapsto k(k+1)/2 \bmod k$ is a bijection on the set $\{0,\ldots,n-1\}$.
  • Or stated differently: For those $n$ I tested, all numbers are triangular modulo $2^n$.
  • That rises two related questions:
  • 1. Does this hold for every $n$?
  • 2. What happens modulo a number $N$ that's not of the form $N=2^n$?
  • Or short: For which $N$ are all numbers triangular modulo $N$?
  • Now it is easily checked that this cannot hold for odd $N$ other than $N=1$, since in that case $(N-1)N/2 \equiv 0 \pmod N$ because the denominator does not cancel out any factor in $N$.
  • I've checked with Python code for $N<10000$, and found that for those, it's exactly the powers of $2$ that fulfil the condition.
  • Therefore my conjecture is:
  • > All numbers are triangular modulo $N$ iff $N$ is a power of $2$.
  • However I have no idea how I could proof (or disproof, other than by a counterexample, which I've obviously not found) this conjecture.
  • Can you shed some light on it?
  • When thinking about binary representations of triangular numbers, I noticed an interesting property:
  • In the cases I've tested, for the numbers from $0$ to $2^n-1$, each combination of the last $n$ bits occurs exactly once, that is, $k\mapsto k(k+1)/2 \bmod 2^n$ is a bijection on the set $\{0,\ldots,2^n-1\}$.
  • Or stated differently: For those $n$ I tested, all numbers are triangular modulo $2^n$.
  • That rises two related questions:
  • 1. Does this hold for every $n$?
  • 2. What happens modulo a number $N$ that's not of the form $N=2^n$?
  • Or short: For which $N$ are all numbers triangular modulo $N$?
  • Now it is easily checked that this cannot hold for odd $N$ other than $N=1$, since in that case $(N-1)N/2 \equiv 0 \pmod N$ because the denominator does not cancel out any factor in $N$.
  • I've checked with Python code for $N<10000$, and found that for those, it's exactly the powers of $2$ that fulfil the condition.
  • Therefore my conjecture is:
  • > All numbers are triangular modulo $N$ iff $N$ is a power of $2$.
  • However I have no idea how I could proof (or disproof, other than by a counterexample, which I've obviously not found) this conjecture.
  • Can you shed some light on it?
#1: Initial revision by user avatar celtschk‭ · 2024-06-09T09:20:21Z (7 months ago)
All numbers are triangular modulo $N$ iff $N$ is a power of $2$?
When thinking about binary representations of triangular numbers, I noticed an interesting property:

In the cases I've tested, for the numbers from $0$ to $2^{n-1}$, each combination of the last $n$ bits occurs exactly once, that is, $k\mapsto k(k+1)/2 \bmod k$ is a bijection on the set $\{0,\ldots,n-1\}$.

Or stated differently: For those $n$ I tested, all numbers are triangular modulo $2^n$.

That rises two related questions:

 1. Does this hold for every $n$?
 2. What happens modulo a number $N$ that's not of the form $N=2^n$?

Or short: For which $N$ are all numbers triangular modulo $N$?

Now it is easily checked that this cannot hold for odd $N$ other than $N=1$, since in that case $(N-1)N/2 \equiv 0 \pmod N$ because the denominator does not cancel out any factor in $N$.

I've checked with Python code for $N<10000$, and found that for those, it's exactly the powers of $2$ that fulfil the condition.

Therefore my conjecture is:

> All numbers are triangular modulo $N$ iff $N$ is a power of $2$.

However I have no idea how I could proof (or disproof, other than by a counterexample, which I've obviously not found) this conjecture.

Can you shed some light on it?