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.

Previous Showing 11-12 of 12 results.

A187553 Smallest prime p such that the sum of the squares of the digits of p equals n (or 0 if no such prime exists).

Original entry on oeis.org

0, 11, 0, 2, 101111, 211, 2111, 101111111, 3, 13, 113, 112121, 23, 21221, 1123, 11213, 41, 1223, 313, 10133, 241, 233, 112223, 21313, 5, 431, 151, 1151, 13313, 251, 2333, 11251, 2243, 53, 1433, 1153, 61, 523, 1523, 11161, 443, 541, 353, 33413, 2621, 163, 1163, 13523, 7, 17
Offset: 1

Views

Author

Michel Lagneau, Mar 26 2011

Keywords

Comments

a(3) = 0 because the numbers of the form 10..010..01 are divisible by 3. Conjecture : except for the numbers 1 and 3, for every possible square digit sum there exists a prime.

Examples

			a(13) = 23 because 2^2 + 3^2 = 13, and 23 is the least such prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for k from 2 to 100 do: id:=0:for p from 1 to 100000 while(id=0)
      do:n:=ithprime(p):l:=length(n):n0:=n:s:=0:for m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+u^2:od: if s=k then id:=1:printf(`%d, `,n):else fi:od:od:

A282342 a(n) is the smallest prime number, with sum of digits equals n and a(n) is greater than previous nonzero terms, except if this is not possible in which case a(n)=0.

Original entry on oeis.org

0, 2, 3, 13, 23, 0, 43, 53, 0, 73, 83, 0, 139, 149, 0, 277, 359, 0, 379, 389, 0, 499, 599, 0, 997, 1889, 0, 1999, 2999, 0, 4999, 6899, 0, 17989, 18899, 0, 29989, 39989, 0, 49999, 59999, 0, 79999, 98999, 0, 199999, 389999, 0, 598999, 599999, 0, 799999, 989999, 0, 2998999
Offset: 1

Views

Author

Dimitris Valianatos, Feb 12 2017

Keywords

Comments

I conjecture that there are prime numbers for every n, if n is not divisible by 3.
Other terms:
a(97) = 79999999999;
a(98) = 98999999999;
a(100) = 298999999999;
a(1000) = 299989999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999.

Examples

			a(23) = 599 because 599 is a prime number greater than a(22) = 499 and the sum of its digits is 5 + 9 + 9 = 23.
a(24) = 0 because 24 (mod 3) = 0.
		

Crossrefs

Cf. A067180.

Programs

  • Mathematica
    a = {1}; Do[If[n != 3 && Divisible[n, 3], AppendTo[a, 0], p = NextPrime@ Max@ a; While[Total@ IntegerDigits@ p != n, p = NextPrime@ p]; AppendTo[a, p]], {n, 2, 57}]; a (* Michael De Vlieger, Feb 12 2017 *)
  • PARI
    {
    print1(0", "2", ");
    n=3;p=3;sp=3;
    while(p<1000000,
            while(sp<>n,
                      p=nextprime(p+1);
                      sp=sumdigits(p);
                    );
                     print1(p", ");
                     n++;if(n%3==0,n++;print1(0", "));
            )
    }
Previous Showing 11-12 of 12 results.