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

A107743 Numbers m such that m+(digit sum of m) is a composite number.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 54, 55, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 93
Offset: 1

Views

Author

Reinhard Zumkeller, May 23 2005

Keywords

Comments

Complement of A047791.

Examples

			A062028(21)=21+(2+1)=24=2*2*2*3, therefore 21 is a term.
		

Crossrefs

Programs

  • Haskell
    a107743 n = a107743_list !! (n-1)
    a107743_list = filter ((== 0) . a010051' . a062028) [1..]
    -- Reinhard Zumkeller, Sep 27 2014
  • Mathematica
    Select[Range[100],CompositeQ[#+Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Oct 12 2016 *)

A048528 Primes expressible in two ways as the sum of an integer and its digit sum.

Original entry on oeis.org

101, 103, 107, 109, 113, 307, 311, 313, 317, 509, 521, 709, 719, 911, 919, 1009, 1013, 1213, 1217, 1409, 1607, 1609, 1613, 1619, 1621, 1811, 1823, 2017, 2027, 2111, 2113, 2309, 2311, 2521, 2711, 2713, 2719, 2917, 2927, 3011, 3209, 3217, 3221, 3407, 3413, 3613, 3617, 3623
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			313 = 296 + (2+9+6) and 313 = 305 + (3+0+5).
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Tally[Select[#+Total[IntegerDigits[#]]&/@ Range[ 5000], PrimeQ]],#[[2]]==2&]][[1]] (* Harvey P. Dale, May 09 2013 *)
  • Python
    from collections import Counter
    from sympy import isprime
    def a_list(upto):
        return [i for i, j in Counter([i+sum(map(int, str(i))) for i in range(upto)]).items() if j>1 and isprime(i)]
    print(a_list(4000)) # Nicholas Stefan Georgescu, Mar 02 2023

Extensions

Corrected and extended by Harvey P. Dale, May 09 2013

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

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","))
Previous Showing 21-26 of 26 results.