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

A062337 Primes whose sum of digits is 7.

Original entry on oeis.org

7, 43, 61, 151, 223, 241, 313, 331, 421, 601, 1033, 1051, 1123, 1213, 1231, 1303, 1321, 2113, 2131, 2203, 2221, 2311, 3121, 3301, 4003, 4021, 4111, 4201, 5011, 5101, 10141, 10303, 10321, 10501, 11113, 11131, 11311, 12211, 12301, 13003, 14011, 20023, 20113
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Comments

There are O((log n)^6) members of this sequence below n.

Examples

			601 is a prime with sum of the digits = 7, hence belongs to the sequence.
		

Crossrefs

Subsequence of A062336. See also A000579, A118703 (no digit 0)
Cf. similar sequences listed in A244918.

Programs

  • Magma
    [p: p in PrimesUpTo(250000) | &+Intseq(p) eq 7]; // Vincenzo Librandi, Jul 08 2014
  • Maple
    A062337 := proc(n)
        option remember ;
        local p ;
        if n = 1 then
            7;
        else
            p := nextprime(procname(n-1)) ;
            while true do
                if digsum(p) = 7 then # digsum in oeis.org/transforms.txt
                    return p;
                else
                    p := nextprime(p) ;
                end if;
            end do:
        end if;
    end proc:
    seq(A062337(n),n=1..80) ; # R. J. Mathar, May 22 2025
  • Mathematica
    Select[Prime[Range[3000]], Plus @@ IntegerDigits[ # ] == 7 &] (* Zak Seidov, Feb 17 2005 *)
  • PARI
    A062337(lim)={my(pow=ceil(log(floor(lim)-.5)/log(10)),n);print("Checking for members of A062337 up to 10^"pow);for(a=0,pow-1,for(b=0,a,for(c=0,b,for(d=0,c,for(e=0,d,for(f=0,e,n=10^a+10^b+10^c+10^d+10^e+10^f+1;if(isprime(n),print1(n","))))))))};
    
  • PARI
    select( {is_A062337(p, s=7)=sumdigits(p)==s&&isprime(p)}, primes([1, 14321])) \\ 2nd optional parameter for similar sequences with other digit sums. M. F. Hasler, Mar 09 2022
    
  • PARI
    {A062337_upto_length(L, s=7, a=List(), u=[10^(L-k)|k<-[1..L]])=forvec(d=[[1, L]|i<-[1..s]], isprime(p=vecsum(vecextract(u, d))) && listput(a, p), 1); Vecrev(a)} \\ M. F. Hasler, Mar 09 2022
    

Formula

Intersection of A000040 (primes) and A052221 (digit sum 7). - M. F. Hasler, Mar 09 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jul 06 2001
Comments and program from Charles R Greathouse IV, Sep 11 2009

A062338 Primes whose sum of digits is a multiple of 4.

Original entry on oeis.org

13, 17, 31, 53, 71, 79, 97, 103, 107, 211, 233, 251, 277, 349, 367, 389, 431, 439, 457, 479, 503, 521, 547, 569, 587, 619, 659, 673, 677, 691, 701, 709, 727, 839, 853, 857, 907, 929, 947, 983, 1021, 1061, 1069, 1087, 1151, 1201, 1223, 1249, 1289, 1429
Offset: 1

Views

Author

Amarnath Murthy, Jun 21 2001

Keywords

Examples

			349 is a prime with sum of digits =16=4*4, hence belongs to the sequence.
		

Crossrefs

Subsequence of A119449.

Programs

  • Magma
    [ p: p in PrimesUpTo(10000) | &+Intseq(p) mod 4 eq 0 ]; /* Vincenzo Librandi, Apr 02 2011 */
    
  • Maple
    filter:= x -> (convert(convert(x,base,10),`+`) mod 4 = 0) and isprime(x);
    A062338:= select(filter, [seq(2*i+1,i=0..1000)]); # Robert Israel, Apr 20 2014
  • PARI
    is(n)=isprime(n) && sumdigits(n)%4==0 \\ Charles R Greathouse IV, Mar 09 2022

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 06 2001
Showing 1-2 of 2 results.