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-20 of 62 results. Next

A088133 Sum of first and last digits of n. Different from A115299.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

Cf. A000030 (first digit of n), A010879 (last digit of n).

Programs

  • Mathematica
    Total[{First[IntegerDigits[#]],Last[IntegerDigits[#]]}]&/@Range[90] (* Harvey P. Dale, Aug 21 2018 *)
  • PARI
    apply( {A088133(n)=n\10^logint(n+!n, 10)+n%10}, [0..99]) \\ M. F. Hasler, Apr 22 2024
    
  • Python
    list(map(A088133 := lambda n: int(str(n)[0])+n%10, range(99))) # M. F. Hasler, Apr 22 2024

Formula

a(n) = A000030(n) + A010879(n). - M. F. Hasler, Apr 22 2024

Extensions

Extended to a(0) = 0 by M. F. Hasler, Apr 22 2024

A088134 Numbers n such that sum of first and last digits is prime.

Original entry on oeis.org

1, 11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 49, 50, 52, 56, 58, 61, 65, 67, 70, 74, 76, 83, 85, 89, 92, 94, 98, 101, 102, 104, 106, 111, 112, 114, 116, 121, 122, 124, 126, 131, 132, 134, 136, 141, 142, 144, 146, 151, 152, 154, 156, 161, 162, 164
Offset: 1

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

A104213 Primes with nonprime sums of digits.

Original entry on oeis.org

13, 17, 19, 31, 37, 53, 59, 71, 73, 79, 97, 103, 107, 109, 127, 149, 163, 167, 181, 211, 233, 239, 251, 257, 271, 277, 293, 307, 347, 349, 367, 383, 389, 419, 431, 433, 439, 457, 479, 491, 499, 503, 509, 521, 523, 541, 547, 563, 569, 587, 613, 617, 619, 631
Offset: 1

Views

Author

Cino Hilliard, Mar 13 2005

Keywords

Comments

Primes with nonprime digital sums. [Juri-Stepan Gerasimov, Apr 23 2010]
Subsequence of primes of A104211. - Michel Marcus, May 03 2015

Examples

			Sum of digits of prime 13 = 4, which is not prime, so 13 is in the sequence.
		

Crossrefs

Cf. A046704 (primes with prime sums of digits), A104211.

Programs

  • Magma
    [p: p in PrimesUpTo(600) | not IsPrime(&+Intseq(p))]; // Vincenzo Librandi, May 03 2015
    
  • Mathematica
    Select[ Prime[ Range[115]], !PrimeQ[Plus @@ IntegerDigits[ # ]] &] (* Robert G. Wilson v, Mar 16 2005 *)
  • PARI
    select(p->!isprime(sumdigits(p)),primes(100)) \\ Joerg Arndt, May 03 2015

Extensions

Definition clarified by Jonathan Sondow, Jun 11 2012

A088135 Sum of first and last digits of n-th prime.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    sfl[p_]:=Module[{idn=IntegerDigits[p]},idn[[1]]+idn[[-1]]]; sfl/@Prime[Range[90]] (* Harvey P. Dale, Jan 31 2023 *)

A091365 Primes p such that the sum of the digits of p is not prime, but the sum of the cubes of the digits of p is prime.

Original entry on oeis.org

997, 2797, 3499, 4993, 7297, 7477, 7927, 8089, 8999, 9277, 9349, 9439, 9907, 11689, 12697, 12967, 14479, 14767, 14929, 14947, 16189, 16477, 16729, 16747, 16927, 16981, 17449, 17467, 18169, 18691, 19249, 19267, 19429, 19447, 19681, 19861
Offset: 1

Views

Author

Chuck Seggelin, Jan 03 2004

Keywords

Comments

Apparently if the cubes of the digits of a prime sum to a prime, it is more likely that the digits themselves also sum to a prime. In the first 10,000 primes there are 1969 primes p such that the cubes of the digits of p sum to a prime. Of these, only 358 are such that the sums of the digits are not prime. Interestingly, all of these primes have a digit sum of 25 or 35. Essentially this sequence is the terms of A091366 (primes whose digits cubed sum to a prime) that do not also appear in A046704 (primes whose digits sum to a prime).

Examples

			a(1)=997 because 9+9+7 = 25 which is not prime, but 9^3+9^3+7^3 = 1801 which is prime.
		

Crossrefs

Cf. A046704 (primes whose digits sum to a prime) A091366 (primes whose digits squared sum to a prime).

Programs

  • Mathematica
    ssdQ[n_]:= Module[{idn = IntegerDigits[n]}, !PrimeQ[Total[idn]]&&PrimeQ[Total[idn^3]]]; Select[Prime[Range[4000]], ssdQ] (* Vincenzo Librandi, Apr 17 2013 *)

A046713 Multiplicative and additive primes: primes where the product and sum of digits are also prime.

Original entry on oeis.org

2, 3, 5, 7, 113, 131, 151, 311, 2111, 11113, 11117, 11131, 11171, 11311, 111121, 111211, 112111, 1111151, 1111711, 1117111, 1171111, 111111113, 111111131, 111113111, 115111111, 131111111, 1111111121, 1111211111, 1121111111, 11111111113, 11111111131, 11113111111
Offset: 1

Views

Author

Keywords

Comments

Any term of this sequence has one prime digit and all other digits are 1. - Sean A. Irvine, Apr 17 2021

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.

Crossrefs

Intersection of A028834, A028842, and A000040.
Intersection of A046703 and A046704.

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; t={}; Do[p=Prime[n]; If[PrimeQ[Plus@@(x=d[p])]&&PrimeQ[Times@@x],AppendTo[t,p]],{n,2*10^5}]; t (* Jayanta Basu, May 18 2013 *)
    Select[Prime[Range[5033*10^5]],AllTrue[{Total[IntegerDigits[ #]],Times@@ IntegerDigits[ #]},PrimeQ]&] (* or -- much faster *) Select[Union[ Flatten[ Table[FromDigits/@Permutations[PadRight[{p},n,1]],{p,{2,3,5,7}},{n,11}]]],AllTrue[{#,Total[ IntegerDigits[#]],Times@@ IntegerDigits[ #]},PrimeQ]&] (* Harvey P. Dale, Feb 28 2022 *)

Extensions

More terms from Harvey P. Dale, Aug 23 2000
Corrected by Jud McCranie, Jan 03 2001
Edited by Charles R Greathouse IV, Aug 02 2010

A225534 Numbers whose sum of cubed digits is prime.

Original entry on oeis.org

11, 101, 110, 111, 113, 115, 122, 124, 128, 131, 139, 142, 146, 148, 151, 155, 164, 166, 182, 184, 193, 199, 212, 214, 218, 221, 223, 227, 232, 236, 238, 241, 245, 254, 256, 263, 265, 269, 272, 278, 281, 283, 287, 289, 296, 298, 311, 319, 322, 326, 328, 335
Offset: 1

Views

Author

Keywords

Comments

Note that 11 is the only two-digit number in the sequence.
a(n) ~ n. For 414 < n < 10000, 6.38*n - 528 provides an estimate of a(n) to within 6%.

Examples

			139 is in the sequence because 1^3 + 3^3 + 9^3 = 757, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[350],PrimeQ[Total[IntegerDigits[#]^3]]&] (* Harvey P. Dale, Mar 16 2016 *)
  • R
    digcubesum<-function(x) sum(as.numeric(strsplit(as.character(x),split="")[[1]])^3); library(gmp);
    which(sapply(1:1000,function(x) isprime(digcubesum(x))>0))

A091367 Primes p such that the sum of the digits raised to the 4th power is prime.

Original entry on oeis.org

11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 113, 131, 179, 191, 197, 223, 269, 311, 313, 331, 353, 379, 397, 401, 443, 461, 601, 607, 641, 661, 719, 739, 809, 883, 911, 937, 971, 1013, 1019, 1031, 1033, 1091, 1097, 1103, 1109, 1181, 1301, 1303, 1367, 1433
Offset: 1

Views

Author

Chuck Seggelin, Jan 03 2004

Keywords

Examples

			a(1) = 11 because 1^4 + 1^4 = 2 which is prime.
a(10) = 89 because 8^4 + 9^4 = 10657 which is prime.
		

Crossrefs

Cf. A046704 (primes whose digits sum to a prime), A052034 (primes whose digits squared sum to a prime), A091366 (primes whose digits cubed sum to a prime).

Programs

  • Mathematica
    upto=500;Select[Prime[Range[upto]],PrimeQ[Total[IntegerDigits[#]^4]]&] (* Paolo Xausa, Nov 23 2021 *)
  • Python
    from sympy import isprime, primerange
    def ok(p): return isprime(sum(int(d)**4 for d in str(p)))
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(1433)) # Michael S. Branicky, Nov 23 2021

A207293 Primes p whose digit sum s(p) is also prime but whose iterated digit sum s(s(p)) is not prime.

Original entry on oeis.org

67, 89, 139, 157, 179, 193, 197, 199, 229, 269, 283, 337, 359, 373, 379, 397, 409, 449, 463, 467, 487, 557, 571, 577, 593, 607, 643, 647, 661, 683, 719, 733, 739, 751, 757, 773, 809, 823, 827, 829, 863, 881, 883, 919, 937, 953, 971, 991, 1039, 1093, 1097, 1129, 1187
Offset: 1

Views

Author

Jonathan Sondow, Jun 09 2012

Keywords

Comments

A046704 is primes p with s(p) also prime. A207294 is primes p with s(p) and s(s(p)) also prime. A070027 is primes p with all s(p), s(s(p)), s(s(s(p))), ... also prime. A104213 is primes p with s(p) not prime. A213354 is primes p with s(p) and s(s(p)) also prime but s(s(s(p))) not prime. A213355 is smallest prime p whose k-fold digit sum s(s(..s(p)..)) is also prime for all k < n, but not for k = n.

Examples

			67 is prime and s(67) = 6+7 = 13 is also prime, but s(s(67)) = s(13) = 1+3 = 4 is not prime. Since no smaller prime has this property, a(1) = 67.
		

Crossrefs

Programs

  • Maple
    isA207293 := proc(n)
        local d;
        if isprime(n) then
            d := digsum(n) ;
            if isprime(d) then
                d := digsum(d) ;
                if isprime(d) then
                    false ;
                else
                    true ;
                end if;
            else
                false ;
            end if;
        else
            false;
        end if;
    end proc:
    A207293 := proc(n)
        option remember ;
        if n = 1 then
            67 ;
        else
            a := nextprime(procname(n-1)) ;
            while not isA207293(a) do
                a := nextprime(a) ;
            end do:
            a ;
        end if;
    end proc: # R. J. Mathar, Feb 04 2021
  • Mathematica
    Select[Prime[Range[300]],
    PrimeQ[Apply[Plus, IntegerDigits[#]]] && !
        PrimeQ[Apply[Plus, IntegerDigits[Apply[Plus, IntegerDigits[#]]]]] &]
    idsQ[n_]:=PrimeQ[Rest[NestList[Total[IntegerDigits[#]]&,n,2]]]=={True,False}; Select[Prime[Range[200]],idsQ] (* Harvey P. Dale, Dec 28 2013 *)
  • PARI
    select(p->my(s=sumdigits(p));isprime(s)&&!isprime(sumdigits(s)), primes(1000)) \\ Charles R Greathouse IV, Jun 10 2012

A207294 Primes p whose digit sum s(p) and iterated digit sum s(s(p)) are also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 83, 101, 113, 131, 137, 151, 173, 191, 223, 227, 241, 263, 281, 311, 313, 317, 331, 353, 401, 421, 443, 461, 599, 601, 641, 797, 821, 887, 911, 977, 1013, 1019, 1031, 1033, 1051, 1091, 1103, 1109, 1123, 1163, 1181, 1213, 1217
Offset: 1

Views

Author

Jonathan Sondow, Jun 09 2012

Keywords

Comments

Sum_{a(n) < x} 1/a(n) is asymptotic to (9/4)*log(log(log(log(x)))) as x -> infinity; see Harman (2012). Thus the sequence is infinite.
The first member not in A070027 is 59899999.
A046704 is primes p with s(p) also prime. A070027 is primes p with all s(p), s(s(p)), s(s(s(p))), ... also prime. A104213 is primes p with s(p) not prime. A207293 is primes p with s(p) also prime, but not s(s(p)). A213354 is primes p with s(p) and s(s(p)) also prime, but not s(s(s(p))). A213355 is smallest prime p whose k-fold digit sum s(s(..s(p)..)) is also prime for all k < n, but not for k = n.

Examples

			59899999 and s(59899999) = 5+9+8+9+9+9+9+9 = 67 and s(s(59899999)) = s(67) = 6+7 = 13 are all primes, so 59899999 is a member. But s(s(s(59899999))) = s(13) = 1+3 = 4 is not prime, so 59899999 is not a member of A070027.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]], PrimeQ[Apply[Plus, IntegerDigits[#]]] && PrimeQ[Apply[Plus, IntegerDigits[Apply[Plus, IntegerDigits[#]]]]] &]
  • PARI
    select(p->my(s=sumdigits(p));isprime(s)&&isprime(sumdigits(s)), primes(1000)) \\ Charles R Greathouse IV, Jun 10 2012
Previous Showing 11-20 of 62 results. Next