login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A344851 a(n) = (n^2) mod (2^A070939(n)). 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
COMMENTS
Informally, if n has w binary digits, a(n) is obtained by keeping the w final binary digits of n^2.
For n > 0, a(n) is the final digit of n^2 in base A062383(n).
This sequence has interesting graphical features (see illustration in Links section).
LINKS
John S. McCaskill and Peter R.Wills, On permutations derived from integer powers x^n, arXiv:1907.01890 [math.NT], 2019.
FORMULA
a(n) = 0 iff n = 0 or n > 1 and n belongs to A116882.
a(n) = 1 iff n belongs to A086341.
a(2^k + m) = a(2^(k+1)-m) for any k > 0 and m = 0..2^k.
EXAMPLE
For n = 42:
- A070939(42) = 6,
- a(42) = (42^2) mod (2^6) = 1764 mod 64 = 36.
MATHEMATICA
{0}~Join~Table[Mod[n^2, 2^(1+Floor@Log2@n)], {n, 100}] (* Giorgos Kalogeropoulos, Jun 02 2021 *)
PROG
(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
CROSSREFS
Cf. A000290, A048152, A062383, A070939, A086341, A116882, A316347 (decimal analog).
Sequence in context: A070432 A170989 A290457 * A346202 A253004 A253011
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, May 30 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 06:14 EDT 2024. Contains 371964 sequences. (Running on oeis4.)