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.

Showing 1-2 of 2 results.

A339023 Replace each digit d in the decimal representation of n with the digital root of n*d.

Original entry on oeis.org

0, 1, 4, 9, 7, 7, 9, 4, 1, 9, 10, 22, 36, 43, 52, 63, 76, 82, 99, 19, 40, 63, 88, 16, 36, 58, 73, 99, 28, 49, 90, 34, 61, 99, 31, 64, 99, 37, 67, 99, 70, 25, 63, 13, 55, 99, 46, 85, 36, 79, 70, 36, 85, 46, 99, 55, 13, 63, 25, 79, 90, 67, 37, 99, 64, 31, 99, 61
Offset: 0

Views

Author

Sebastian Karlsson, Jan 18 2021

Keywords

Examples

			a(23) = 16 because 2*23 = 46 and 3*23 = 69 and the digital roots of 46 and 69 are 1 and 6.
		

Crossrefs

Programs

  • PARI
    dr(n) = if(n, (n-1)%9+1); \\ A010888
    a(n) = if (n==0, return(0)); my(d=digits(n), s=""); for (k=1, #d, s=concat(s, dr(n*d[k]))); eval(s); \\ Michel Marcus, Jan 18 2021
  • Python
    def digitalroot(n):
        return 0 if n == 0 else (n-1)%9 + 1
    def a(n):
        return int(''.join([str(digitalroot(n*int(d))) for d in str(n)]))
    for n in range(0, 68):
        print(a(n), end=', ')
    

Formula

a(9*n + 1) = 9*n + 1.
a(10*n) = 10*a(n). - Sebastian Karlsson, Feb 14 2021

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

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 30 2021

Keywords

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).

Examples

			For n = 42:
- A070939(42) = 6,
- a(42) = (42^2) mod (2^6) = 1764 mod 64 = 36.
		

Crossrefs

Cf. A000290, A048152, A062383, A070939, A086341, A116882, A316347 (decimal analog).

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

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.
Showing 1-2 of 2 results.