cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A344851 a(n) = (n^2) mod (2^A070939(n)).

This page as a plain text file.
%I A344851 #20 Jun 09 2021 02:25:05
%S A344851 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,
%T A344851 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,
%U A344851 49,36,25,16,9,4,1,0,1,4,9,16,25,36,49,64,81,100
%N A344851 a(n) = (n^2) mod (2^A070939(n)).
%C A344851 Informally, if n has w binary digits, a(n) is obtained by keeping the w final binary digits of n^2.
%C A344851 For n > 0, a(n) is the final digit of n^2 in base A062383(n).
%C A344851 This sequence has interesting graphical features (see illustration in Links section).
%H A344851 Rémy Sigrist, <a href="/A344851/b344851.txt">Table of n, a(n) for n = 0..8192</a>
%H A344851 John S. McCaskill and Peter R.Wills, <a href="https://arxiv.org/abs/1907.01890">On permutations derived from integer powers x^n</a>, arXiv:1907.01890 [math.NT], 2019.
%H A344851 Rémy Sigrist, <a href="/A344851/a344851.png">Scatterplot of the sequence for n = 2^18..2^19</a>
%F A344851 a(n) = 0 iff n = 0 or n > 1 and n belongs to A116882.
%F A344851 a(n) = 1 iff n belongs to A086341.
%F A344851 a(2^k + m) = a(2^(k+1)-m) for any k > 0 and m = 0..2^k.
%e A344851 For n = 42:
%e A344851 - A070939(42) = 6,
%e A344851 - a(42) = (42^2) mod (2^6) = 1764 mod 64 = 36.
%t A344851 {0}~Join~Table[Mod[n^2,2^(1+Floor@Log2@n)],{n,100}] (* _Giorgos Kalogeropoulos_, Jun 02 2021 *)
%o A344851 (PARI) a(n) = (n^2) % 2^#binary(n)
%o A344851 (Python)
%o A344851 def a(n): return (n**2) % (2**n.bit_length())
%o A344851 print([a(n) for n in range(75)]) # _Michael S. Branicky_, May 30 2021
%Y A344851 Cf. A000290, A048152, A062383, A070939, A086341, A116882, A316347 (decimal analog).
%K A344851 nonn,base,easy
%O A344851 0,7
%A A344851 _Rémy Sigrist_, May 30 2021