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

A076161 Numbers n such that n + sum of squares of digits of n (A258881) is a prime.

Original entry on oeis.org

1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 31, 34, 57, 73, 74, 75, 78, 91, 94, 97, 100, 101, 102, 103, 105, 107, 108, 109, 121, 122, 123, 126, 127, 128, 140, 142, 146, 148, 160, 161, 165, 166, 168, 182, 183, 188, 213, 216, 217, 234, 251, 275, 277, 297, 301
Offset: 1

Views

Author

Zak Seidov, Nov 01 2002

Keywords

Examples

			12 is a term because 12+(1^2+2^2) = 17 is a prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local t; isprime(n+add(t^2,t=convert(n,base,10))) end proc:
    select(filter, [$1..1000]); # Robert Israel, Jan 30 2021
  • PARI
    isok(n) = isprime(n + norml2(digits(n))); \\ Michel Marcus, Jan 31 2021
  • Python
    from sympy import isprime
    def ssd(n): return sum(int(d)**2 for d in str(n))
    def ok(n): return isprime(n + ssd(n))
    def aupto(limit): return [m for m in range(1, limit+1) if ok(m)]
    print(aupto(301)) # Michael S. Branicky, Jan 30 2021
    

A329179 Numbers k such that A258881(k) is a square.

Original entry on oeis.org

0, 23, 36, 52, 71, 80, 104, 137, 143, 154, 377, 443, 479, 533, 823, 963, 977, 1013, 1125, 1204, 1284, 1334, 1493, 1624, 1769, 1786, 1997, 2047, 2110, 2228, 2260, 2427, 2508, 2577, 2707, 2740, 3121, 3174, 3223, 3407, 3440, 3477, 3526, 3644, 3745, 3828, 3860, 4027, 4079, 4163, 4314, 4384, 4518
Offset: 1

Views

Author

Will Gosnell and Robert Israel, Nov 07 2019

Keywords

Examples

			a(3) = 36 is a member of the sequence because 36 + 3^2 + 6^2 = 81 = 9^2.
		

Crossrefs

Programs

  • Maple
    filter:= n -> issqr(n + convert(map(`^`,convert(n,base,10),2),`+`)):
    select(filter, [$0..10^4]);
  • Mathematica
    Select[Range[0,5000],IntegerQ[Sqrt[#+Total[IntegerDigits[#]^2]]]&] (* Harvey P. Dale, Jan 01 2022 *)
  • PARI
    isok(k) = issquare(k+norml2(digits(k))); \\ Michel Marcus, Jan 31 2021
  • Python
    from sympy.ntheory.primetest import is_square
    def ssd(n): return sum(int(d)**2 for d in str(n))
    def ok(n): return is_square(n + ssd(n))
    def aupto(limit): return [m for m in range(limit+1) if ok(m)]
    print(aupto(4000)) # Michael S. Branicky, Jan 30 2021
    

A259391 Numbers n such that A258881(n+k) is prime for k=0,...,9; where A258881(x) = x + sum of the square of the digits of x (A003132).

Original entry on oeis.org

10, 1761702690, 7226006660, 16453361570, 95748657190, 104217487100, 111058349320, 141665059420, 168759510430, 177313689280, 177313689330, 178209124090, 188343072120, 347296044930, 347296045010, 381449093790, 381449093840, 445151776780, 491570264380
Offset: 1

Views

Author

M. F. Hasler, Jul 19 2015

Keywords

Comments

Terms computed by G. Resta, cf. link to Prime Puzzle 776.

Examples

			For n = 10, A258881(10) = 10 + 1^2 + 0^2 = 11, A258881(11) = 11 + 1^2 + 1^2 = 13, A258881(12) = 12 + 1^2 + 2^2 = 17, ..., A258881(19) = 19 + 1^2 + 9^2 = 101 are all prime, therefore a(1) = 10.
The next value of 10 in A259567 occurs at index n = 1761702690 = a(2).
		

Crossrefs

A259567 Number of subsequent numbers, starting with n, for which A258881(x) = x + (sum of squares of digits of x) is prime.

Original entry on oeis.org

0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

M. F. Hasler, Jul 19 2015

Keywords

Comments

This sequence is motivated by sequence A259391 and the "Prime puzzle 776".

Examples

			For n = 0, A258881(0) = 0 is not prime.
For n = 1, A258881(1) = 1+1 = 2 is prime, but A258881(2) = 2+4 is not prime, therefore a(1)=1.
For n = 10, A258881(10) = 10 + 1^2 + 0^2 = 11, A258881(11) = 11 + 1^2 + 1^2 = 13, A258881(12) = 12 + 1^2 + 2^2 = 17, ..., A258881(19) = 19 + 1^2 + 9^2 = 101 are all prime, but A258881(20) = 20 + 2^2 + 0^2 is not prime, therefore a(10) = 10.
The next value of 10 occurs at index n = 1761702690, see A259391.
		

Crossrefs

Programs

  • PARI
    a(n)=for(m=n,n+9e9,isprime(A258881(m))||return(m-n))

Formula

If a(n) > 0, then a(n+1) = a(n)-1.
a(n) > 0 iff n is in A076161.

A342953 a(n) is the least prime that starts a string of exactly n primes p_1, p_2, ... p_n where p_{i+1} = A258881(p_i), but A258881(p_n) is not prime.

Original entry on oeis.org

2, 13, 11, 19, 499, 8851471
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Mar 31 2021

Keywords

Comments

No further terms below 10^9.

Examples

			a(3) = 11 because 11, A258881(11) = 13, and A258881(13) = 23 are prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember; local t,x;
      x:= n + add(t^2,t=convert(n,base,10));
      if not isprime(x) then 1 else 1+procname(x) fi
    end proc:
    V:= Vector(6): count:= 0: p:= 1:
    while count < 6 do
      p:= nextprime(p); v:= f(p);
      if v <= N and V[v] = 0 then V[v]:= p; count:= count+1 fi
    od:
    convert(V,list);

A033936 a(n+1) = a(n) + sum of squares of digits of a(n).

Original entry on oeis.org

1, 2, 6, 42, 62, 102, 107, 157, 232, 249, 350, 384, 473, 547, 637, 731, 790, 920, 1005, 1031, 1042, 1063, 1109, 1192, 1279, 1414, 1448, 1545, 1612, 1654, 1732, 1795, 1951, 2059, 2169, 2291, 2381, 2459, 2585, 2703, 2765, 2879, 3077, 3184
Offset: 0

Views

Author

Olivier Gorin (gorin(AT)roazhon.inra.fr)

Keywords

Comments

Orbit of 1 under iterations of A258881. - M. F. Hasler, Jul 23 2015

Examples

			After 1063, since 1^2 + 0^2 + 6^2 + 3^2 = 46 we get 1063+46 = 1109.
		

Crossrefs

Programs

  • Maple
    A[0] := 1;
    for n to 50 do
       A[n] := A[n-1]+add(t^2, t = convert(A[n-1], base, 10))
    od:
    seq(A[i],i=0..50); # Robert Israel, Feb 15 2018
  • Mathematica
    NestList[#+Total[IntegerDigits[#]^2]&,1,45] (* Harvey P. Dale, Aug 14 2011 *)

Formula

a(n+1) = A258881(a(n)). a(n) = (A258881^n)(1). - M. F. Hasler, Jul 23 2015

A307735 Integers k such that if m = k + A003132(k) then k = m - A003132(m).

Original entry on oeis.org

0, 9, 205, 212, 217, 366, 457, 663, 1314, 1315, 1348, 1672, 1742, 1792, 1797, 2005, 2012, 2017, 2129, 2201, 2208, 2213, 2216, 2305, 2404, 2405, 2465, 2564, 2565, 2671, 2741, 2748, 2789, 2829, 3114, 3115, 3205, 3303, 3306, 3394, 3436, 3475, 3696, 3819, 4204, 4205, 4245, 4347, 4475, 4542, 4629, 4647, 4688
Offset: 1

Views

Author

Antonio Roldán, Apr 25 2019

Keywords

Comments

A003132(n) is the sum of the squares of the digits of n.

Examples

			205 is in the sequence because 205 + 2^2 + 0^2 + 5^2 = 234 and 234 - 2^2 - 3^2 - 4^2 = 205.
		

Crossrefs

Programs

  • Mathematica
    sod2[n_] := Total @ (IntegerDigits[n]^2); aQ[n_] := sod2[n + (s=sod2[n])] == s; Select[Range[0, 4700], aQ] (* Amiram Eldar, Jul 03 2019 *)
  • PARI
    for(i = 0 , 5000 , a = i + norml2(digits(i)) ; b = a - norml2(digits(a)) ; if(i == b , print1(i , ", ")))
Showing 1-7 of 7 results.