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 31-40 of 92 results. Next

A347702 Prime numbers that give a remainder of 1 when divided by the sum of their digits.

Original entry on oeis.org

11, 13, 17, 41, 43, 97, 101, 131, 157, 181, 233, 239, 271, 311, 353, 401, 421, 491, 521, 541, 599, 617, 631, 647, 673, 743, 811, 859, 953, 1021, 1031, 1051, 1093, 1171, 1201, 1249, 1259, 1301, 1303, 1327, 1373, 1531, 1601, 1621, 1801, 1871, 2029, 2111, 2129, 2161
Offset: 1

Views

Author

Burak Muslu, Sep 10 2021

Keywords

Examples

			97 is a term since its sum of digits is 9+7 = 16, and 97 mod 16 = 1.
		

Crossrefs

Subsequence of A209871.
A259866 \ {31}, and the primes associated with A056804 \ {1, 2} and A056797 are subsequences.

Programs

  • Maple
    select(t -> isprime(t) and t mod convert(convert(t,base,10),`+`) = 1, [seq(i,i=3..10000,2)]); # Robert Israel, Mar 05 2024
  • Mathematica
    Select[Range[2000], PrimeQ[#] && Mod[#, Plus @@ IntegerDigits[#]] == 1 &] (* Amiram Eldar, Sep 10 2021 *)
  • PARI
    isok(p) = isprime(p) && ((p % sumdigits(p)) == 1); \\ Michel Marcus, Sep 10 2021
  • Python
    from sympy import primerange
    def ok(p): return p%sum(map(int, str(p))) == 1
    print(list(filter(ok, primerange(1, 2130)))) # Michael S. Branicky, Sep 10 2021
    

A370848 Lesser of two consecutive primes such that the product of its digits is also prime and the sum of the digits of the other is composite.

Original entry on oeis.org

13, 17, 31, 71, 113, 1151, 11131, 112111, 113111, 131111, 1111211, 1111711, 11111117, 11111171, 71111111, 115111111, 1111111121, 1111115111, 1115111111, 1117111111, 1151111111, 1711111111, 11111111113, 11113111111, 31111111111, 111113111111, 111511111111, 1111171111111
Offset: 1

Views

Author

Claude H. R. Dequatre, Mar 03 2024

Keywords

Examples

			13 is a term because 13 is prime, the product of its digits is 3 which is also prime and the sum of the digits of 17, the next prime to 13, is 8 which is composite.
23 is not a term because the product of its digits is 6 which is not prime.
131 is not a term because although it is prime and the product of its digits is 3 which is also prime, the sum of the digits of 137, the next prime to 131, is 11 which is not composite.
		

Crossrefs

Cf. A370850.
Except for the first, all terms of this sequence are in A370851.

Programs

  • Mathematica
    Select[Prime[Range[5*10^6]],PrimeQ[Apply[Times,IntegerDigits[#]]]&&CompositeQ[Total[IntegerDigits[NextPrime[#]]]]&] (* James C. McMahon, Mar 03 2024 *)
  • PARI
    isok(p)=my(x=vecprod(digits(p)),y=sumdigits(nextprime(p+1)));isprime(x) && !isprime(y);
    forprime(p=2,20000,if(isok(p),print1(p", ")))
    
  • PARI
    a370848(maxdigits=20) = {my (L=List()); for (n=2, maxdigits, my (r=(10^n-1)/9, d=digits(r)); foreach ([2,3,5,7], s, for (k=1, #d, my (dd=d); dd[k]=s; my(q=fromdigits(dd)); if (ispseudoprime(q) && ! isprime(sumdigits(nextprime(q+1))), listput(L,q))))); vecsort(Vec(L))};
    a370848() \\ Hugo Pfoertner, Mar 03 2024
    
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def A370848_gen(): # generator of terms
        for l in count(1):
            k = (10**l-1)//9
            for m in range(l):
                a = 10**m
                for j in (1,2,4,6):
                    p = k+a*j
                    if isprime(p) and not isprime(sum(map(int,str(nextprime(p))))):
                        yield p
    A370848_list = list(islice(A370848_gen(),20)) # Chai Wah Wu, Mar 25 2024

Extensions

a(17)-a(21) from Michel Marcus, Mar 03 2024
a(22)-a(28) from Hugo Pfoertner, Mar 03 2024

A007513 a(n) = initial prime of n consecutive primes such that first and last have same digit sum.

Original entry on oeis.org

2, 523, 109, 79, 2, 13, 5, 127, 47, 17, 5, 127, 53, 17, 7, 67, 31, 37, 47, 37, 83, 11, 43, 19, 157, 2, 37, 5, 47, 5, 19, 67, 7, 29, 19, 53, 31, 73, 53, 29, 139, 13, 67, 83, 7, 47, 29, 17, 79, 7, 19, 37, 59, 43, 271, 19, 29, 181, 167, 59, 97, 5, 149, 7, 59, 337, 41, 53, 43, 127
Offset: 1

Views

Author

Keywords

Examples

			523 and 541 are first pair of consecutive primes with same sum of digits (10).
		

References

  • J. R. Smart, A new function from a table of primes, J. Rec. Math., 7 (No. 4, 1974), 293-294.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

  • Haskell
    import Data.Function (on)
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a007513 n = a000040_list !! (fromJust $ elemIndex 0 $
       zipWith ((-) `on` a007953) a000040_list $ drop (n-1) a000040_list)
    -- Reinhard Zumkeller, Aug 17 2011
  • Maple
    A007953 := proc(n) local d; add(d,d=convert(n,base,10)) ; end proc: A007605 := proc(n) A007953(ithprime(n)) ; end proc: A007513 := proc(n) for i from 1 do if A007605(i) = A007605(i+n-1) then return ithprime(i) ; end if; end do ; end proc: seq(A007513(n),n=1..120) ; # R. J. Mathar, Dec 09 2009
  • Mathematica
    prms=Prime[Range[2000]];First/@Table[First[Select[Partition[prms,n,1], Total[ IntegerDigits[ First[#]]]==Total[IntegerDigits[Last[#]]]&]], {n,75}] (* Harvey P. Dale, May 20 2011 *)

Extensions

Terms beyond a(57) by R. J. Mathar, Dec 09 2009

A058049 Numbers k such that the sum of the digits of the first k primes is a prime.

Original entry on oeis.org

1, 2, 4, 5, 6, 7, 8, 11, 12, 14, 23, 33, 43, 45, 48, 64, 69, 72, 73, 77, 87, 94, 95, 96, 98, 110, 118, 124, 130, 133, 140, 148, 152, 154, 157, 162, 171, 174, 178, 181, 196, 200, 201, 206, 210, 212, 219, 232, 241, 244, 253, 257, 267, 269, 272, 277, 299, 304, 306
Offset: 1

Views

Author

Robert G. Wilson v, Nov 18 2000

Keywords

Comments

What is intriguing about this sequence is that the number of primes less than 10^m is of the same magnitude as A006880. Here they begin 7, 25, 122, 934.

Examples

			5 is a term because sum of digits of first 5 primes, 2+3+5+7+(1+1)=19, is prime.
a(5) = 6 because in A051351(6) = 2 + 3 + 5 + 7 + 2 (sum of eleven's digits) + 4 (sum of thirteen's digits) which equals the sum of the digits through the sixth prime = 23 which itself is a prime.
		

Crossrefs

Corresponding primes: A104247. Primes: A000040, sum of digits of primes: A007605.
Cf. A051351.

Programs

  • Mathematica
    s = 0; Do[ s = s + Apply[ Plus, RealDigits[ Prime[ n ]] [[1]] ]; If[ PrimeQ[ s ], Print[ n ] ], {n, 1, 1000} ]
  • PARI
    isok(n) = isprime(sum(k=1, n, sumdigits(prime(k)))); \\ Michel Marcus, Mar 11 2017
    
  • Python
    from sympy import isprime, nextprime
    def sd(n): return sum(map(int, str(n)))
    def aupto(limit):
        alst, k, p, s = [], 1, 2, 2
        while k <= limit:
            if isprime(s): alst.append(k)
            k += 1; p = nextprime(p); s += sd(p)
        return alst
    print(aupto(306)) # Michael S. Branicky, Jul 18 2021

Extensions

Edited by R. J. Mathar, Aug 04 2008

A081653 Greatest common divisor of sums of decimal digits of n and of n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 4, 1, 1, 1, 2, 1, 2, 1, 1, 2, 5, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 7, 1, 1, 2, 11, 1, 1, 2, 1, 1, 2, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 25 2003

Keywords

Examples

			a(8) = GCD(A007953(8), A007953(A000040(8))) = GCD(8, A007953(19)) = GCD(8,1+9) = GCD(4*2,5*2) = 2.
		

Crossrefs

Programs

Formula

a(n) = GCD(A007953(n), A007605(n)).

A104260 Sum of odd digits (1,3,5,7,9) of n-th prime.

Original entry on oeis.org

0, 3, 5, 7, 2, 4, 8, 10, 3, 9, 4, 10, 1, 3, 7, 8, 14, 1, 7, 8, 10, 16, 3, 9, 16, 2, 4, 8, 10, 5, 8, 5, 11, 13, 10, 7, 13, 4, 8, 11, 17, 2, 11, 13, 17, 19, 2, 3, 7, 9, 6, 12, 1, 6, 12, 3, 9, 8, 14, 1, 3, 12, 10, 5, 7, 11, 7, 13, 10, 12, 11, 17, 10, 13, 19, 6, 12, 19, 1, 9, 10, 1, 4, 6, 12, 3, 9, 12
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Crossrefs

Sum of even digits (2, 4, 6, 8) of n-th prime: A104261, sum of prime digits (2, 3, 5, 7) of n-th prime: A104250, sum of composite (nonprime) digits (1, 4, 6, 8, 9) of n-th prime: A104251, sum of digits of primes: A007605, primes: A000040.

Programs

  • Mathematica
    sodod={};Do[id=IntegerDigits[Prime[i]];lid=Length[id];sod=Sum[If[OddQ[id[[k]]], id[[k]], 0], {k, lid}];sodod={sodod, sod}, {i, 200}];sodod//Flatten
    f[n_] := Plus @@ Select[ IntegerDigits[ Prime[n]], OddQ[ # ] &]; Table[ f[n], {n, 88}] (* Robert G. Wilson v, Nov 03 2005 *)

Formula

a(n) = A007605(n) - A104261(n).

A104261 Sum of even digits (0,2,4,6,8) of n-th prime.

Original entry on oeis.org

2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 4, 4, 4, 0, 0, 6, 6, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 6, 6, 0, 0, 8, 0, 0, 0, 0, 2, 4, 4, 4, 2, 2, 6, 2, 2, 8, 8, 2, 2, 10, 10, 2, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 6, 0, 0, 8, 8, 0, 4, 4, 4, 6, 4, 4, 4, 8, 8, 4, 10, 10, 10, 4, 12, 4, 4, 0, 0, 2, 2, 4, 4, 0
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Crossrefs

Sum of odd digits (1, 3, 5, 7, 9) of n-th prime: A104260, sum of prime digits (2, 3, 5, 7) of n-th prime: A104250, sum of composite (nonprime) digits (1, 4, 6, 8, 9) of n-th prime: A104251, sum of digits of primes: A007605, primes: A000040.

Programs

  • Mathematica
    sodev={};Do[id=IntegerDigits[Prime[i]];lid=Length[id];sod=Sum[If[EvenQ[id[[k]]], id[[k]], 0], {k, lid}];sodev={sodev, sod}, {i, 200}];sodev//Flatten
    f[n_] := Plus @@ Select[ IntegerDigits[ Prime[n]], EvenQ[ # ] && # > 1 &]; Table[ f[n], {n, 102}] (* Robert G. Wilson v, Nov 03 2005 *)

Formula

A104261(n) = A007605(n) - A104260(n).

A158293 Primes whose digit sum is a multiple of 10.

Original entry on oeis.org

19, 37, 73, 109, 127, 163, 181, 271, 307, 389, 433, 479, 523, 541, 569, 587, 613, 631, 659, 677, 811, 839, 857, 929, 947, 983, 1009, 1063, 1117, 1153, 1171, 1289, 1423, 1487, 1531, 1559, 1621, 1667, 1801, 1847, 1973, 2017, 2053, 2099, 2143, 2161, 2251
Offset: 1

Views

Author

Parthasarathy Nambi, Mar 15 2009

Keywords

Examples

			The digit sum of 1009 is a multiple of ten.
		

Crossrefs

Cf. A007605.

Programs

  • Magma
    [ p: p in PrimesUpTo(2500) | &+Intseq(p) mod 10 eq 0 ];
  • Mathematica
    Select[Prime[Range[335]], GCD[(Plus@@IntegerDigits[#]), 10] >= 10 &] (* Alonso del Arte, Jan 31 2011 *)
    Select[Prime[Range[400]],Divisible[Total[IntegerDigits[#]],10]&] (* Harvey P. Dale, Aug 19 2012 *)

A165439 Primes p such that 3+2*(sum of digits of p) is also a prime.

Original entry on oeis.org

2, 5, 7, 11, 13, 17, 19, 23, 31, 37, 41, 43, 53, 59, 61, 67, 71, 73, 89, 101, 103, 107, 109, 113, 127, 131, 139, 149, 151, 157, 163, 167, 179, 181, 193, 197, 199, 211, 223, 229, 233, 239, 241, 251, 257, 269, 271, 283, 293, 307, 311, 313, 331, 337, 347, 359, 373
Offset: 1

Views

Author

Vincenzo Librandi, Sep 19 2009

Keywords

Examples

			331 is in the sequence because 3+3+1=7 and 2*7+3=17 is prime.
		

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(400) | IsPrime(q) where q is 3+2*(&+Intseq(p))];  // Bruno Berselli, Jul 15 2011
  • Mathematica
    Select[Prime[Range[200]],PrimeQ[2 Total[IntegerDigits[#]]+3]&] (* Harvey P. Dale, Jul 14 2011 *)

Extensions

Keyword:base added by R. J. Mathar, Oct 12 2009

A165440 Primes p such that 3+2*(sum of digits of p) is not a prime.

Original entry on oeis.org

3, 29, 47, 79, 83, 97, 137, 173, 191, 227, 263, 277, 281, 317, 349, 353, 367, 439, 443, 457, 461, 547, 599, 619, 641, 673, 691, 709, 727, 797, 821, 853, 887, 907, 911, 977, 1019, 1069, 1087, 1091, 1109, 1163, 1181, 1217, 1249, 1307, 1361, 1429, 1433, 1447
Offset: 1

Views

Author

Vincenzo Librandi, Sep 19 2009

Keywords

Examples

			1087 is in the sequence because 1+0+8+7=16 and 2*16+3=35 is not prime.
		

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(1500) | not IsPrime(q) where q is 3+2*(&+Intseq(p))];  // Bruno Berselli, Jul 15 2011
  • Mathematica
    Select[Prime[Range[250]],!PrimeQ[2*Total[IntegerDigits[#]]+3]&] (* Harvey P. Dale, Jul 15 2014 *)

Extensions

Keyword:base added by R. J. Mathar, Sep 21 2009
Previous Showing 31-40 of 92 results. Next