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

A094877 Primes that are reached in A094830.

Original entry on oeis.org

2, 2, 3, 199, 5, 107, 7, 547, 263, 11, 11, 17, 13, 31, 41, 53, 17, 83, 19, 199, 643, 563, 23, 199, 547, 643, 1301, 227, 29, 563, 31, 643, 439, 59, 643, 199, 37, 199, 563, 269, 41, 107, 43, 199, 643, 643, 47, 197, 199, 149, 439, 199, 53, 547, 131, 269, 131, 227, 59
Offset: 1

Views

Author

Jason Earls, Jun 15 2004

Keywords

Comments

If n is prime, a(n) = n. - Robert Israel, Oct 27 2016

Crossrefs

Cf. A094830.

Programs

  • Maple
    f:= proc(n) local x, t;
      x:= n;
      do
       if isprime(x) then return x fi;
       x:= x + add(t^2, t = convert(x,base,10))
      od;
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 27 2016
  • Mathematica
    p2[n_]:=NestWhile[#+Total[IntegerDigits[#]^2]&,n,!PrimeQ[#]&]; Array[p2,60] (* Harvey P. Dale, Dec 03 2011 *)

A094878 n sets a new record in A094830.

Original entry on oeis.org

1, 4, 8, 21, 27, 64, 253, 1629, 4284, 4416, 5992, 19621, 78399, 204347, 298735, 848999, 1202402, 1496888, 1539370, 1987614, 2859485, 5460483, 6160282, 14539187, 22103424, 40412450, 95261053, 105703913, 105703932, 123434487
Offset: 1

Views

Author

Jason Earls, Jun 15 2004

Keywords

Extensions

a(15)-a(30) from Donovan Johnson, Feb 06 2010

A094879 Where 1's occur in A094830 (nonprimes that reach a prime in one step under iteration of "x -> x + sum of squares of digits of x").

Original entry on oeis.org

1, 10, 12, 14, 15, 16, 18, 34, 57, 74, 75, 78, 91, 94, 100, 102, 105, 108, 121, 122, 123, 126, 128, 140, 142, 146, 148, 160, 161, 165, 166, 168, 182, 183, 188, 213, 216, 217, 234, 275, 297, 301, 324, 327, 341, 387, 412, 413, 415, 418, 432, 450, 453, 455, 458
Offset: 1

Views

Author

Jason Earls, Jun 15 2004

Keywords

Programs

  • Mathematica
    Select[Range[500],!PrimeQ[#]&&PrimeQ[#+Total[IntegerDigits[#]^2]]&] (* Harvey P. Dale, Mar 15 2015 *)

A277717 Primes that only occur once in A094877.

Original entry on oeis.org

3, 5, 7, 13, 19, 23, 29, 37, 43, 47, 61, 67, 71, 73, 79, 89, 97, 103, 109, 113, 151, 179, 181, 193, 211, 223, 233, 241, 277, 281, 283, 293, 307, 313, 331, 337, 347, 349, 359, 373, 379, 383, 397, 401, 409, 419, 421, 443, 449, 463, 467, 479, 487, 523, 557
Offset: 1

Views

Author

Robert Israel, Oct 27 2016

Keywords

Comments

Primes n that are not k + A003132(k) for any nonprime k < n.

Crossrefs

Programs

  • Maple
    N:= 1000: # to get the first N terms
    res:= NULL: count := 0:
    for n from 1 while count < N do
      if isprime(n) then
        if R[n] <> false then count:= count+1; res:= res, n fi
      else
        v:= n + add(t^2, t=convert(n,base,10));
        if isprime(v) then R[v]:= false fi;
      fi
    od:
    res;
  • Mathematica
    With[{nn = 1200}, TakeWhile[#, # <= nn/2 &] &@ First@ Transpose@ TakeWhile[#, Last@ # == 1 &] &@ SortBy[#, Last] &@ Tally@ Array[NestWhile[# + Total[IntegerDigits[#]^2] &, #, ! PrimeQ@ # &] &, nn]] (* Michael De Vlieger, Oct 27 2016, after Harvey P. Dale at A094877 *)
Showing 1-4 of 4 results.