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 21-28 of 28 results.

A320881 Numbers equal to a prime plus its digit sum.

Original entry on oeis.org

4, 6, 10, 13, 14, 17, 25, 28, 29, 35, 40, 46, 47, 50, 58, 61, 68, 73, 79, 80, 83, 94, 95, 103, 106, 107, 113, 115, 118, 119, 136, 137, 148, 152, 158, 163, 170, 173, 181, 184, 191, 196, 202, 206, 214, 215, 218, 230, 238, 241, 242, 248, 253, 259, 271, 274, 281, 286, 292, 293, 296, 307, 316
Offset: 1

Views

Author

M. F. Hasler, Nov 08 2018

Keywords

Comments

Sequence A048520 lists the primes in this sequence.

Examples

			a(1) = 4 = 2 + 2 = (the smallest prime, 2 = prime(1)) + (digit sum of 2).
Similarly, a({2, 3, 5}) = 2*prime({2, 3, 4}), since the digit sum of single-digit primes is the prime itself.
a(4) = 13 = 11 + (1 + 1) = A048520(1), the first prime in this sequence.
a(6) = 17 = 13 + (1 + 3) = A048520(2), the second prime in this sequence.
		

Crossrefs

Cf. A062028 (n + its digit sum), A047791 (A062028(n) is prime), A048519 (primes in A047791).

Programs

  • PARI
    is_A320881(n)=select(p->p+sumdigits(p)==n, primes([n-9*#digits(n), n-2])) \\ Returns the list of all "solutions"; this has the boolean value of true iff the list is nonempty. - M. F. Hasler, Nov 08 2018

A092529 Primes p such that both the digit sum of p plus p and the digit product of p plus p are also primes.

Original entry on oeis.org

163, 233, 293, 431, 499, 563, 617, 743, 1423, 1483, 1489, 1867, 2273, 2543, 2633, 3449, 4211, 4217, 4273, 4547, 4729, 5861, 6121, 6529, 6637, 6653, 6761, 6857, 6949, 7681, 8273, 8431, 8837, 8839, 9649, 9689
Offset: 1

Views

Author

Ray G. Opao, Apr 08 2004

Keywords

Comments

Intersection of A048519 and A092518.
Zeros are not permitted in p; thus, for example, 101 is not included. - Harvey P. Dale, May 25 2013

Examples

			a(2) = 233: 233+(2+3+3) = 233+8 = 241, which is prime. 233+(2*3*3) = 233+18 = 251, which is prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(p) local L;
      if not isprime(p) then return false fi;
      L:= convert(p,base,10);
      if member(0,L) then return false fi;
      isprime(p + convert(L,`+`)) and isprime(p + convert(L,`*`))
    end proc:
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Feb 20 2024
  • Mathematica
    pppQ[n_]:=Module[{idn=IntegerDigits[n]},!MemberQ[idn,0]&&And@@PrimeQ[ {n+ Total[idn], n+Times@@idn}]]; Select[Prime[Range[1200]],pppQ] (* Harvey P. Dale, May 25 2013 *)

Extensions

More terms from Robert G. Wilson v, Apr 10 2004

A128717 Primes that yield another prime if one adds either the sum of its digits or the product of its digits.

Original entry on oeis.org

101, 103, 163, 233, 293, 307, 431, 499, 509, 563, 617, 701, 743, 1009, 1049, 1061, 1087, 1409, 1423, 1483, 1489, 1601, 1607, 1801, 1867, 2017, 2039, 2053, 2273, 2543, 2633, 2903, 3041, 3067, 3089, 3449, 3607, 4013, 4057, 4079, 4211, 4217, 4273, 4507
Offset: 1

Views

Author

J. M. Bergot, Jun 27 2007

Keywords

Examples

			163 + (1+6+3) = 173, 163 + 1*6*3 = 181; 173 and 181 are prime numbers.
		

Crossrefs

Cf. A048519.

Programs

  • Maple
    filter:= proc(n) local S;
      S:= convert(n,base,10);
      isprime(n+convert(S,`+`)) and isprime(n+convert(S,`*`))
    end proc:
    A:= NULL:
    p:= 2:
    while p < 10000 do
      if filter(p) then A:= A, p fi;
      p:= nextprime(p)
    od:
    A; # Robert Israel, Jul 12 2017
  • Mathematica
    Select[Prime[Range[500]], PrimeQ[ # + Plus @@ IntegerDigits[ # ]] && PrimeQ[ # + Times @@ IntegerDigits[ # ]] &]
  • PARI
    isok(n) = isprime(n) && (isprime(n+sumdigits(n)) && ((d=digits(n)) && isprime(n+prod(k=1, #d, d[k])))); \\ Michel Marcus, Jul 12 2017

Extensions

Edited, corrected and extended by Stefan Steinerberger, Jul 14 2007

A230087 Primes such that prime plus its digit sum is a perfect square.

Original entry on oeis.org

2, 17, 179, 347, 467, 521, 1433, 1583, 2111, 3347, 10601, 12527, 25889, 28541, 32027, 33113, 39569, 39971, 41201, 43661, 45767, 55667, 58061, 59513, 61001, 62969, 63977, 67061, 70199, 77261, 92387, 92993, 100469, 109541, 120401, 122477, 130307, 156011, 163193
Offset: 1

Views

Author

K. D. Bajpai, Oct 08 2013

Keywords

Comments

Number of primes obtained from the sequence ‘prime plus its digit sum is perfect square’ is 150 for n = 1 to 3*10^5, while the sequence for ‘perfect cube’ yields only 11 primes for the same range of n. Hence, sequence for ‘square’ is framed.
Subsequence of primes of A066564. - Michel Marcus, Jun 02 2015

Examples

			a(2) = 17 is prime. Digit sum of 17 = 8, 17 + 8 = 25 = 5^2.
a(5) = 467 is prime. Digit sum of 467 = 17, 467 + 17 = 484 = 22^2.
		

Crossrefs

Cf. A048519.
Cf. A107288 (Primes whose digit sum is square).

Programs

  • Magma
    [p: p in PrimesUpTo(6*10^5) | IsSquare(p+(&+Intseq(p)))]; // Vincenzo Librandi, Jun 02 2015
  • Maple
    KD:= proc() local a,b,c,d; a:= ithprime(n);b:=add( i,i = convert((a), base, 10))(a); c:=a+b; d:=evalf(sqrt(c)); if d=floor(d) then return (a) :fi;end:seq(KD(),n=1..50000);
  • PARI
    for(n=2,1e4,forprime(p=n^2-9*#digits(n^2),n^2, if(p+sumdigits(p) == n^2, print1(p", ")))) \\ Charles R Greathouse IV, Oct 08 2013
    

Extensions

a(1) from Charles R Greathouse IV, Oct 08 2013

A247896 Primes that produce a different prime when one of its digits is added to it.

Original entry on oeis.org

29, 43, 61, 67, 89, 167, 227, 239, 263, 269, 281, 349, 367, 389, 439, 457, 461, 463, 487, 499, 521, 563, 601, 607, 613, 641, 643, 647, 653, 677, 683, 821, 827, 983, 1063, 1229, 1277, 1283, 1289, 1361, 1367, 1423, 1427, 1429, 1447, 1481, 1483, 1489, 1549, 1601
Offset: 1

Views

Author

Paolo P. Lava, Sep 26 2014

Keywords

Comments

From an idea of Eric Angelini (see seqfan link).
Digit 0 is not considered because the new primes must be different from the starting numbers. Therefore, 101 is not part of the sequence, because the only prime that results from adding one of its digits is 101 + 0 = 101, which is the same number, while 601 is acceptable because 601 + 6 = 607, a prime.

Examples

			The number 29 is prime, and 29 + 2 = 31 is also prime.
The same with 487, which produces 487 + 4 = 491, a prime.
		

Crossrefs

Programs

  • Haskell
    a247896 n = a247896_list !! (n-1)
    a247896_list = filter f a000040_list where
       f p = any ((== 1) . a010051') $
                 map (+ p) $ filter (> 0) $ map (read . return) $ show p
    -- Reinhard Zumkeller, Sep 27 2014
  • Maple
    P:=proc(q) local a,b,k,n,ok;
    for n from 1 to q do a:=ithprime(n); ok:=0;
    for k from 1 to ilog10(a)+1 do
    b:=trunc((a mod 10^k)/10^(k-1)); if b>0 then
    if isprime(a+b) then ok:=1; break; fi; fi; od;
    if ok=1 then print(a); fi; od; end: P(10^6);
  • PARI
    /* Description: Generates a vector containing this kind of terms between m^u1 and m^u2 for this definition applied by adding base B digits to the original number in decimal. Here (u1,m,B)=(1,3,10) by default. */
    LstThem(u2,u1=1,m=3,B=10)={
      my(L:list=List(),y);
      forprime(x=m^u1,m^u2,
        y=vecsort(digits(x,B),,8);
        if(sum(j=1,#y,y[j]&&isprime(x+y[j])),
          listput(L,x)));
      vector(#L,i,L[i])} \\ R. J. Cano, Sep 27 2014
    

A320869 Primes such that p + digitsum(p, base 16) is again a prime.

Original entry on oeis.org

17, 19, 23, 29, 31, 53, 59, 89, 127, 149, 151, 157, 179, 181, 211, 223, 241, 251, 263, 269, 331, 359, 367, 397, 419, 431, 449, 457, 461, 463, 487, 541, 563, 571, 593, 599, 601, 631, 659, 661, 701, 733, 761, 769, 809, 811, 839, 907, 911, 941, 971, 997, 1049, 1087, 1109, 1171, 1201, 1237, 1283, 1289, 1291
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for an even base b. See A048519, A243441, A320866, A320867 and A320868 for the analog in base 10, 2, 4, 6 and 8, respectively. Also, as in base 10, there are no such primes when + is changed to -, see comment in A243442.

Examples

			17 = 16 + 1 = 11[16] (in base 16), and 17 + 1 + 1 = 19 is again prime.
		

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320866 (analog for base 4), A320867 (analog for base 6), A320868 (analog for base 8).

Programs

  • Maple
    digsum:= (n,b) -> convert(convert(n,base,b),`+`):
    select(p -> isprime(p) and isprime(p+digsum(p,16)), [2,seq(i,i=3..1000,2)]); # Robert Israel, Nov 07 2018
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,16))&&print1(p","))

A320882 Primes p such that repeated application of A062028 (add sum of digits) yields two other primes in a row: p, A062028(p) and A062028(A062028(p)) are all prime.

Original entry on oeis.org

11, 59, 101, 149, 167, 257, 277, 293, 367, 419, 479, 547, 617, 727, 839, 1409, 1559, 1579, 1847, 2039, 2129, 2617, 2657, 2837, 3449, 3517, 3539, 3607, 3719, 4217, 4637, 4877, 5689, 5779, 5807, 5861, 6037, 6257, 6761, 7027, 7489, 7517, 8039, 8741, 8969, 9371, 9377, 10667, 10847, 10937, 11257, 11279, 11299, 11657
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

"Iterates" the idea of A048519 (p and A062028(p) are prime), also considered in A048523, A048524, A048525, A048526, A048527. (This is the union of A048524, A048525, A048526, A048527 etc. A048525(1) = 277 = a(7).)

Crossrefs

Subsequence of A048519: p and A062028(p) are prime.
Cf. A047791, A048520, A006378, A107740, A243441 (p and p + Hammingweight(p) are prime), A243442 (analog for p - Hammingweight(p)).
Cf. A048523, ..., A048527, A320878, A320879, A320880: primes starting a chain of length 2, ..., 9 under iterations of A062028(n) = n + digit sum of n.

Programs

  • Maple
    f:= n -> n + convert(convert(n,base,10),`+`):
    filter:= proc(n) local x;
    if not isprime(n) then return false fi;
    x:= f(n);
    isprime(x) and isprime(f(x))
    end proc:
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Dec 17 2020
  • PARI
    is_A320882(n,p=n)=isprime(p=A062028(p))&&isprime(A062028(p))&&isprime(n) \\ Putting isprime(n) to the end is more efficient for the frequent case when the terms are already known to be prime.
    forprime(p=1,14999,isprime(q=A062028(p))&&isprime(A062028(q))&&print1(p","))

A225519 Primes of the form p + sum of squares of digits of p, where p is prime.

Original entry on oeis.org

13, 23, 41, 67, 101, 103, 113, 131, 157, 181, 191, 227, 281, 379, 421, 457, 461, 467, 547, 659, 677, 677, 751, 809, 811, 829, 839, 877, 1039, 1039, 1091, 1093, 1109, 1187, 1201, 1223, 1319, 1361, 1439, 1453, 1531, 1567, 1571, 1613, 1663, 1693, 1753, 1789
Offset: 1

Views

Author

Jayanta Basu, May 09 2013

Keywords

Comments

Primes generated by A076162.

Examples

			41 is a member since 41=31+(3^2+1^2).
		

Crossrefs

Programs

  • Mathematica
    Sort[Select[Table[p=Prime[n]; p+Total[IntegerDigits[p]^2],{n,262}],PrimeQ]]
Previous Showing 21-28 of 28 results.