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.

A258881 a(n) = n + the sum of the squared digits of n.

Original entry on oeis.org

0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 11, 13, 17, 23, 31, 41, 53, 67, 83, 101, 24, 26, 30, 36, 44, 54, 66, 80, 96, 114, 39, 41, 45, 51, 59, 69, 81, 95, 111, 129, 56, 58, 62, 68, 76, 86, 98, 112, 128, 146, 75, 77, 81, 87, 95, 105, 117, 131, 147, 165, 96, 98, 102
Offset: 0

Views

Author

M. F. Hasler, Jul 19 2015

Keywords

Crossrefs

Cf. A003132, A062028, A259391, A259567, A033936, A076161 (indices of primes), A329179 (indices of squares).

Programs

  • Mathematica
    Total[Flatten@ {#, IntegerDigits[#]^2}] & /@ Range[0, 61] (* Michael De Vlieger, Jul 20 2015 *)
    Table[n+Total[IntegerDigits[n]^2],{n,0,100}] (* Harvey P. Dale, Nov 27 2022 *)
  • PARI
    A258881(n)=n+norml2(digits(n))
    
  • Python
    def ssd(n): return sum(int(d)**2 for d in str(n))
    def a(n): return n + ssd(n)
    print([a(n) for n in range(63)]) # Michael S. Branicky, Jan 30 2021

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
    

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

Showing 1-3 of 3 results.