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 63 results. Next

A090178 a(1) = 2; for n > 1, a(n) = n + prime(n-1).

Original entry on oeis.org

2, 4, 6, 9, 12, 17, 20, 25, 28, 33, 40, 43, 50, 55, 58, 63, 70, 77, 80, 87, 92, 95, 102, 107, 114, 123, 128, 131, 136, 139, 144, 159, 164, 171, 174, 185, 188, 195, 202, 207, 214, 221, 224, 235, 238, 243, 246, 259, 272, 277, 280, 285, 292, 295, 306, 313, 320, 327
Offset: 1

Views

Author

Pab Ter (pabrlos(AT)yahoo.com), May 29 2004

Keywords

Comments

Sum of index n and the corresponding n-th term of noncomposite numbers (A008578).
Does n > 2 exist such that n*prime(n-1)/(n+prime(n-1)), i.e., A164931(n)/a(n) is an integer? - Jaroslav Krizek, Aug 31 2009
Complement of A171508(n). - Jaroslav Krizek, Dec 13 2009

Examples

			a(2) = 2 + prime(1) = 4; a(5) = 5 + prime(4) = 12; a(9) = 9 + prime(8) = 28.
		

References

  • M. Feenstra, P. J. Carter and C. P. Harding, The Ultimate I.Q. Book, Wardlock, see p. 99.

Crossrefs

The published version (A048171) is said to be incorrect.

Programs

  • Magma
    [n + NthPrime(n-1): n in [1..58] ]; // Klaus Brockhaus, Sep 09 2009
  • Mathematica
    Join[{2}, Table[Prime[n - 1] + n, {n, 2, 60}]] (* Vincenzo Librandi, Dec 08 2015 *)

Formula

a(n) = n + A008578(n). - David Wasserman, May 20 2008
a(1) = 2; a(n) = 1 + A014688(n-1), for n >= 2. - Omar E. Pol, Nov 01 2013

Extensions

Definition corrected, second comment and example edited by Klaus Brockhaus, Sep 09 2009

A106587 Sum of n-th prime squared and n-th perfect square.

Original entry on oeis.org

5, 13, 34, 65, 146, 205, 338, 425, 610, 941, 1082, 1513, 1850, 2045, 2434, 3065, 3770, 4045, 4850, 5441, 5770, 6725, 7418, 8497, 10034, 10877, 11338, 12233, 12722, 13669, 17090, 18185, 19858, 20477, 23426, 24097, 26018, 28013, 29410, 31529, 33722
Offset: 1

Views

Author

Alexandre Wajnberg, May 10 2005

Keywords

Examples

			a(5)=146 because 121 (fifth prime^2) + 25 (fifth square) = 146.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n)^2 + n^2: n in [1..50]]; // G. C. Greubel, Sep 07 2021
    
  • Mathematica
    Table[Prime[n]^2 + n^2, {n, 50}]
  • PARI
    a(n) = n^2 + prime(n)^2; \\ Michel Marcus, Sep 08 2021
  • Sage
    [nth_prime(n)^2 + n^2 for n in (1..50)] # G. C. Greubel, Sep 07 2021
    

Formula

a(n) = n^2 + prime(n)^2.

Extensions

Extended by Ray Chandler, May 13 2005

A115884 Numbers k such that the k-th prime plus k gives a palindrome.

Original entry on oeis.org

1, 2, 3, 4, 22, 45, 66, 71, 75, 88, 94, 97, 103, 105, 116, 140, 331, 432, 454, 565, 646, 703, 795, 1042, 1108, 1168, 1248, 1334, 1644, 1652, 1864, 1874, 1900, 2181, 2295, 2323, 2485, 2509, 2585, 2679, 2835, 2899, 2923, 3052, 3360, 3372, 3396, 3404
Offset: 1

Views

Author

Giovanni Resta, Feb 06 2006

Keywords

Examples

			prime(103) + 103 = 666, a palindrome; so 103 is a term.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local p,L;
       p:= ithprime(n)+n;
       L:= convert(p,base,10);
       ListTools:-Reverse(L) = L
    end proc:
    select(filter, [$1..10000]); # Robert Israel, Nov 04 2014
  • Mathematica
    palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]; With[ {nn=3500}, Rest[Flatten[Position[Total/@Thread[{Prime[Range[nn]], Range[nn]}],?(palQ)]]]] (* _Harvey P. Dale, Oct 11 2011 *)
    palQ[n_] := Reverse[x = IntegerDigits[n]] == x; Select[Range[3405], palQ[Prime[#] + #] &] (* Jayanta Basu, Jun 24 2013 *)
  • PARI
    ispal(n) = my(e=digits(n));e == Vecrev(e) \\ A002113
    for(k=1,10^6,b=k+prime(k);if(ispal(b),print1(k,", "))) \\ Alexandru Petrescu, Jun 15 2022
    
  • Python
    from sympy import nextprime
    def ispal(n): s = str(n); return s == s[::-1]
    def agen(): # generator of terms
        k, pk = 1, 2
        while True:
            if ispal(k+pk): yield k
            k, pk = k+1, nextprime(pk)
    g = agen()
    print([next(g) for n in range(1, 51)]) # Michael S. Branicky, Jun 15 2022

A332086 a(n) = pi(prime(n) + n) - n, where pi is the prime counting function.

Original entry on oeis.org

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

Views

Author

Ya-Ping Lu, Aug 22 2020

Keywords

Comments

This sequence is related to a theorem of Lu and Deng (see LINKS): “The prime gap of a prime number is less than or equal to the prime count of the prime number”, which is equivalent to “There exists at least one prime number between p and p+pi(p)+1”, or pi(p+pi(p)) - pi(p) > 1, where pi is prime counting function. The n-th term of the sequence, a(n), is the number of prime number between the n-th prime number p_n and p_n + pi(p_n) + 1. According to the theorem, a(n) >= 1.

Examples

			a(1) = pi(p_1 + 1) - 1 = pi(2 + 1) - 1 = 2 - 1 = 1;
a(2) = pi(p_2 + 2) - 2 = pi(3 + 2) - 2 = 3 - 2 = 1;
a(6) = pi(p_6 + 6) - 6 = pi(13 + 6) - 6 = 8 - 6 = 2;
a(80) = pi(p_80 + 80) - 80 = pi(409 + 80) - 80 = 93 - 80 = 13.
		

Crossrefs

Cf. A000720 (pi), A014688 (prime(n)+n).

Programs

  • Maple
    f:= n -> numtheory:-pi(ithprime(n)+n)-n:
    map(f, [$1..100]); # Robert Israel, Sep 08 2020
  • Mathematica
    a[n_] := PrimePi[Prime[n] + n] - n; Array[a, 100] (* Amiram Eldar, Aug 23 2020 *)
  • PARI
    a(n) = primepi(prime(n) + n) - n; \\ Michel Marcus, Aug 23 2020
  • Python
    from sympy import prime, primepi
    for n in range(1, 1001):
        a = primepi(prime(n) + n) - n
        print(a)
    

Formula

a(n) = pi(prime(n) + n) - n.
a(n) = A000720(A014688(n)) - n. - Michel Marcus, Aug 23 2020

Extensions

Name edited by Michel Marcus, Sep 02 2020

A093572 Greatest prime factor of Product(k+prime(k): 1<=k<=n).

Original entry on oeis.org

3, 5, 5, 11, 11, 19, 19, 19, 19, 19, 19, 19, 19, 19, 31, 31, 31, 79, 79, 79, 79, 101, 101, 113, 113, 127, 127, 127, 127, 127, 127, 163, 163, 173, 173, 173, 173, 173, 173, 173, 173, 223, 223, 223, 223, 223, 223, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 01 2004

Keywords

Comments

a(n) = A006530(A093570(n)) = A006530(A093571(n));
a(n) = Max(A076556(k): 1<=k<=n).

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_Integer] := Flatten[ Table[ # [[1]], {1}] & /@ FactorInteger[n]]; Table[ PrimeFactors[ Product[k + Prime[k], {k, n}]][[ -1]], {n, 60}] (* Robert G. Wilson v, Apr 07 2004 *)
    FactorInteger[#][[-1,1]]&/@FoldList[Times,Table[n+Prime[n],{n,60}]] (* Harvey P. Dale, May 27 2016 *)

Extensions

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

A097935 Number of primes that are not less than prime(n)-n and not greater than prime(n)+n.

Original entry on oeis.org

2, 3, 4, 4, 3, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 8, 8, 9, 8, 9, 9, 10, 10, 12, 10, 10, 10, 11, 11, 12, 13, 13, 12, 13, 12, 12, 14, 16, 15, 15, 14, 15, 17, 17, 17, 17, 17, 18, 18, 19, 19, 19, 20, 18, 18, 20, 19, 19, 20, 21, 21, 21, 20, 21, 21, 23, 22, 23, 21, 22, 22, 22, 23, 24, 25
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 05 2004

Keywords

Examples

			a(10) = #{p prime: A000040(10)-10 <= p <= A000040(10)+10} = #{p prime: 19 <= p <= 39} = #{19,23,29,31,37} = 5.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := PrimePi[Prime[n] + n] - PrimePi[Prime[n] - n - 1];
    Array[a, 100] (* Jean-François Alcover, Jun 11 2019 *)
  • PARI
    a(n) = my(p=prime(n)); primepi(p+n) - primepi(p-n-1); \\ Michel Marcus, Jun 11 2019
  • Sage
    [len([k for k in (nth_prime(n)-n..nth_prime(n)+n) if is_prime(k)]) for n in (1..75)]  # Peter Luschny, Sep 03 2013
    

Formula

a(n) = A000720(A014688(n)) - A000720(A014689(n)-1).

A098390 Prime(n)+Log2(prime(n)), where Log2=A000523.

Original entry on oeis.org

3, 4, 7, 9, 14, 16, 21, 23, 27, 33, 35, 42, 46, 48, 52, 58, 64, 66, 73, 77, 79, 85, 89, 95, 103, 107, 109, 113, 115, 119, 133, 138, 144, 146, 156, 158, 164, 170, 174, 180, 186, 188, 198, 200, 204, 206, 218, 230, 234, 236, 240, 246, 248, 258, 265, 271, 277, 279
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 06 2004

Keywords

Comments

a(n) = A000040(n) + A098388(n).

Examples

			a(10) = A000040(10) + A098388(10) = 29 + 4 = 33.
		

Crossrefs

Programs

  • Mathematica
    #+Floor[Log[2,#]]&/@Prime[Range[60]] (* Harvey P. Dale, Dec 30 2011 *)

A025003 a(1) = 2; a(n+1) = a(n)-th nonprime, where nonprimes begin at 1.

Original entry on oeis.org

2, 4, 8, 14, 22, 33, 48, 66, 90, 120, 156, 202, 256, 322, 400, 494, 604, 734, 888, 1067, 1272, 1512, 1790, 2107, 2472, 2890, 3364, 3903, 4515, 5207, 5990, 6875, 7868, 8984, 10238, 11637, 13207, 14959, 16909, 19075, 21483, 24173, 27149, 30436, 34080, 38103
Offset: 1

Views

Author

Keywords

Comments

Index of first occurrence of n in A090532.
Let b(n) (n >= 0) be the smallest integer k >= 1 that takes n steps to reach 1 iterating the map f: k -> k - pi(k). The sequence {b(n), n >= 0} begins 1, 2, 4, 8, 14, 22, 33, 48, 66, 90, 120, 156, ... and agrees with the present sequence except for b(0). - Ya-Ping Lu, Sep 07 2020

Examples

			From _Ya-Ping Lu_, Sep 07 2020: (Start)
a(1) = 2 because f(2) = 2 - pi(2) = 1 and m(2) = 1;
For the integer 3, since f(3) = 1. m(3) = 1, which is not bigger than m(1) or m(2). So, 3 is not a term in the sequence;
a(2) = 4 because f^2(4) = f(2) = 1 and m(4) = 2;
a(3) = 8 because f^3(8) = f^2(4) = 1 and m(8) = 3. (End)
		

Crossrefs

Programs

  • Maple
    N:= 50: # to get a(0)..a(N)
    V:= Array(0..N):
    V[0]:= 1: V[1]:= 2:
    m:= 2: p:= 3: g:= 1: n:= 1:
    do
      if g+p-m-1 >= V[n] then
        m:= V[n]+m-g;
        n:= n+1;
        V[n]:= m;
        if n = N then break fi;
        g:= V[n-1];
      else
        g:= g+p-m;
        m:= p+1;
        p:= nextprime(m);
      fi;
    od;
    convert(V, list); # Robert Israel, Sep 08 2020
  • Python
    from sympy import prime, primepi
    n_last = 0
    pi_last = 0
    ct_max = -1
    for n in range(1, 100001):
        ct = 0
        pi = pi_last + primepi(n) - primepi(n_last)
        n_c = n
        pi_c = pi
        while n_c > 1:
            nc -= pi_c
            ct += 1
            pi_c -= primepi(n_c + pi_c) - primepi(n_c)
        if ct > ct_max:
            print(n)
            ct_max = ct
        n_last = n
        pi_last = pi # Ya-Ping Lu, Sep 07 2020

Formula

a(n) = min(k: f^n(k) = 1), where f = A062298 and n-fold iteration of f is denoted by f^n. - Ya-Ping Lu, Sep 07 2020

A064427 a(n) = n + (number of primes < n).

Original entry on oeis.org

1, 2, 4, 6, 7, 9, 10, 12, 13, 14, 15, 17, 18, 20, 21, 22, 23, 25, 26, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 40, 41, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 55, 56, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 80, 81, 82
Offset: 1

Views

Author

Santi Spadaro, Sep 30 2001

Keywords

Comments

From Jaroslav Krizek, Dec 10 2009: (Start)
Complement of A014688.
Numbers that are not the sum of k and the k-th prime for any k >= 1. (End)

Crossrefs

Programs

  • Haskell
    a064427 1 = 1
    a064427 n = a000720 (n - 1) + toInteger n
    -- Reinhard Zumkeller, Apr 17 2012
    
  • Magma
    [1] cat [#PrimesUpTo(n-1)+n: n in [2..100]]; // Vincenzo Librandi, Feb 13 2016
  • Mathematica
    a[n_] := PrimePi[a[n-1]]+n; a[1]=1
    Table[PrimePi[n-1]+n,{n,60}] (* Harvey P. Dale, Apr 03 2015 *)
  • PARI
    a(n) = if (n==1, 1, primepi(n-1)+n); \\ Michel Marcus, Feb 13 2016
    

Formula

For n > 1: a(n) = n + A000720(n-1).

Extensions

Definition improved by Reinhard Zumkeller, Apr 16 2012
Edited by Jon E. Schoenfield, Nov 24 2023

A093570 a(n) = Product_{k=1..n}(k + prime(k)).

Original entry on oeis.org

3, 15, 120, 1320, 21120, 401280, 9630720, 260029440, 8320942080, 324516741120, 13629703127040, 667855453224960, 36064194474147840, 2055659085026426880, 127450863271638466560, 8794109565743054192640, 668352326996472118640640
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 01 2004

Keywords

Comments

a(n) < A000142(n) + A002110(n) for n>1;
a(n) = Product_{k=1..n}A014688(k).

Crossrefs

Programs

  • Mathematica
    Table[ Product[k + Prime[k], {k, n}], {n, 17}] (* Robert G. Wilson v, Apr 07 2004 *)
    FoldList[Times,Table[m+Prime[m],{m,20}]] (* Harvey P. Dale, Jun 04 2023 *)

Extensions

More terms from Robert G. Wilson v, Apr 07 2004
Previous Showing 11-20 of 63 results. Next