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-3 of 3 results.

A350590 Prime numbers p such that iterating the map m -> m^2 + 1 on p generates a number ending with p.

Original entry on oeis.org

2, 5, 7, 677, 948901, 55904677, 88948901, 36414201356422028396069993813455904677, 8964456980291877636414201356422028396069993813455904677, 711873588184178964456980291877636414201356422028396069993813455904677
Offset: 1

Views

Author

Ya-Ping Lu, Jan 07 2022

Keywords

Comments

Primes in A350130. All terms, except the first two terms, end with either 1 or 7.
It takes six iterations for a term in the sequence to generate a number ending with the term itself.
If two terms, a(i) and a(j) with i < j, share the same last digit of 1 or 7, then a(j) ends with a(i). For example, a(5)=948901, a(7)=88948901, and a(11)=8941500847661758065828477233177642295842210081239701539110201588948901. a(11) ends with a(7), which ends with a(5).

Examples

			2 is a term because 2 is a prime and iterating the map on 2 gives: 2 -> 5 -> 26 -> 677 -> 458330 -> 210066388901 -> 44127887745906175987802, which ends with 2.
		

Crossrefs

Programs

  • Python
    from sympy import isprime; R = []
    for i in range(1, 100):
        m = 1; L = [m]; m = (m*m+1)%10**i
        while m not in L: L.append(m); m = (m*m+1)%10**i
        del L[:L.index(m)]; {R.append(j) for j in L if isprime(j) and j not in R}
    R.sort(); print(*R, sep = ", ")

A356130 a(n) = Sum_{k=1..n} sigma_{n-1}(k).

Original entry on oeis.org

1, 4, 16, 111, 999, 12513, 185683, 3316418, 67810767, 1576561677, 40862702931, 1171104916405, 36722498575799, 1251419967587955, 46034784688102781, 1818440444592581068, 76763036794222996512, 3448830049286378614987, 164309958491233496689189
Offset: 1

Views

Author

Seiichi Manyama, Jul 27 2022

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[DivisorSigma[n-1, k], {k, 1, n}]; Array[a, 19] (* Amiram Eldar, Jul 28 2022 *)
  • PARI
    a(n) = sum(k=1, n, sigma(k, n-1));
    
  • PARI
    a(n) = sum(k=1, n, k^(n-1)*(n\k));
    
  • Python
    from math import isqrt
    from sympy import bernoulli
    def A350130(n): return (((s:=isqrt(n))+1)*((b:=bernoulli(n))-bernoulli(n, s+1))+sum(k**(n-1)*n*((q:=n//k)+1)-b+bernoulli(n, q+1) for k in range(1,s+1)))//n if n>1 else 1 # Chai Wah Wu, Oct 21 2023

Formula

a(n) = Sum_{k=1..n} k^(n-1) * floor(n/k).
a(n) = [x^n] (1/(1-x)) * Sum_{k>=1} k^(n-1) * x^k/(1 - x^k).

A354832 Integers m such that iterating the map f(x) = x^2 + 1 on m generates a number ending with m in binary format.

Original entry on oeis.org

0, 1, 2, 5, 10, 26, 37, 90, 165, 421, 933, 1957, 4005, 8101, 8282, 24666, 40869, 106405, 237477, 286810, 811098, 1286053, 3383205, 5005402, 11771813, 28549029, 38559834, 105668698, 239886426, 296984485, 833855397, 1313628250, 3461111898, 7756079194, 9423789989
Offset: 1

Views

Author

Ya-Ping Lu, Jun 07 2022

Keywords

Comments

It seems that 2^(n-2) <= a(n) < 2^(n-1) for n > 1.
All terms are part of a cycle under x -> f(x) mod 2^L. For example, 5 = f(2), 10 = f(5) mod (2^4), 26 = f(5), 37 = f(10) mod (2^6), and 90 = f(5) mod (2^6).
It takes 2 iterations for a term in the sequence to generate a number ending with the term itself in binary format. Endings of the numbers in the 2 iterations, m1 -> m2 -> m1, for the number of binary digits (d) up to 10 are given below. Note that m1 and m2 are bit-by-bit complement to each other, due to the fact that f(f(x)) = x mod 2^L as pointed out by Kevin Ryde in Discussion.
d m1 or m2 (bin) m2 or m1 (bin) m1 (decimal)
-- ------------------ ------------------ ------------------
1 0 (m1/m2) 1 (m2/m1) a(1) = 0; a(2) = 1
2 10 (m1) 01 (m2) a(3) = 2
3 010 (m2) 101 (m1) a(4) = 5
4 1010 (m1) 0101 (m2) a(5) = 10
5 11010 (m1) 00101 (m2) a(6) = 26
6 011010 (m2) 100101 (m1) a(7) = 37
7 1011010 (m1) 0100101 (m2) a(8) = 90
8 01011010 (m2) 10100101 (m1) a(9) = 165
9 001011010 (m2) 110100101 (m1) a(10)= 421
10 0001011010 (m2) 1110100101 (m1) a(11)= 933

Examples

			26 is a term because iterating the map on 26 gives, in binary format, 11010 -> 1010100101 -> 1101111111001011010, which ends with 11010.
		

Crossrefs

Programs

  • Python
    R = []
    for i in range(0, 34):
        t = 2**i; L = []
        while t not in L: L.append(t); t = (t*t + 1) % 2**(i+1)
        {R.append(j) for j in {L[-1], L[-2]} if j not in R}
    R.sort(); print(*R, sep = ', ')
Showing 1-3 of 3 results.