A344851 a(n) = (n^2) mod (2^A070939(n)).
0, 1, 0, 1, 0, 1, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 16, 25, 4, 17, 0, 17, 4, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 0, 17, 36, 57, 16, 41, 4, 33, 0, 33, 4, 41, 16, 57, 36, 17, 0, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Offset: 0
Examples
For n = 42: - A070939(42) = 6, - a(42) = (42^2) mod (2^6) = 1764 mod 64 = 36.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..8192
- John S. McCaskill and Peter R.Wills, On permutations derived from integer powers x^n, arXiv:1907.01890 [math.NT], 2019.
- Rémy Sigrist, Scatterplot of the sequence for n = 2^18..2^19
Programs
-
Mathematica
{0}~Join~Table[Mod[n^2,2^(1+Floor@Log2@n)],{n,100}] (* Giorgos Kalogeropoulos, Jun 02 2021 *)
-
PARI
a(n) = (n^2) % 2^#binary(n)
-
Python
def a(n): return (n**2) % (2**n.bit_length()) print([a(n) for n in range(75)]) # Michael S. Branicky, May 30 2021
Comments