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 20 results.

A064960 The prime then composite recurrence; a(2n) = a(2n-1)-th prime and a(2n+1) = a(2n)-th composite and a(1) = 1.

Original entry on oeis.org

1, 2, 6, 13, 22, 79, 108, 593, 722, 5471, 6290, 62653, 69558, 876329, 951338, 14679751, 15692307, 289078661, 305618710, 6588286337, 6908033000, 171482959009, 178668550322, 5040266614919, 5225256019175, 165678678591359, 171068472492228, 6039923990345039
Offset: 1

Views

Author

Robert G. Wilson v, Oct 29 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; a = {1}; b = 1; Do[ If[ !PrimeQ[b], b = Prime[b], b = Composite[b]]; a = Append[a, b], {n, 1, 23}]; a
  • Python
    from functools import cache
    from sympy import prime, composite
    @cache
    def A064960(n): return 1 if n == 1 else composite(A064960(n-1)) if n % 2 else prime(A064960(n-1)) # Chai Wah Wu, Jan 01 2022

Extensions

a(26)-a(28) from Chai Wah Wu, May 07 2018

A064961 Composite-then-prime recurrence; a(2n) = a(2n-1)-th composite and a(2n+1) = a(2n)-th prime and a(1) = 1.

Original entry on oeis.org

1, 4, 7, 14, 43, 62, 293, 366, 2473, 2892, 26317, 29522, 344249, 376259, 5429539, 5831545, 101291779, 107457490, 2198218819, 2310909505, 54720307351, 57128530327, 1543908890351, 1603146693999, 48871886538151, 50527531769529, 1720466016680911, 1772475453490311
Offset: 1

Views

Author

Robert G. Wilson v, Oct 29 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; a = {1, 4}; b = 4; Do[ If[ !PrimeQ[b], b = Prime[b], b = Composite[b]]; a = Append[a, b], {n, 1, 23}]; a

Extensions

a(24)-a(26) corrected and a(27)-a(28) added by Chai Wah Wu, Aug 22 2018

A072415 a(1) = 2; a(n) = a(n-1)-th even nontotient number.

Original entry on oeis.org

2, 26, 182, 878, 3626, 13508, 46922, 155156, 494468, 1529590, 4615074, 13633310, 39548078, 112918434, 317920082, 883996002
Offset: 1

Views

Author

Labos Elemer, Jun 17 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a = Table[0, {10^6}]; Do[b = EulerPhi[n]/2; If[b < 10^6 + 1, a[[b]] = 1], {n, 1, 2 10^7}]; b = Select[ Range[10^6], a[[ # ]] == 0 &]; c = 1; Do[ Print[c]; c = 2b[[c]], {n, 0, 8}]

Formula

a(3)=182 is the 26th = a(2)-th term in A005277.

Extensions

Edited by Robert G. Wilson v, Jun 20 2002
a(11)-a(16) from Donovan Johnson, Oct 29 2010

A072416 a(1) = 2; a(n) = half of the a(n-1)-th even nontotient number.

Original entry on oeis.org

2, 13, 49, 149, 373, 835, 1727, 3383, 6341, 11419, 19966, 34067, 56967, 93578, 151313, 241281, 379934, 591413, 910879, 1389289, 2099905, 3147743, 4682362, 6914234, 10141072, 14779023, 21408820, 30837491, 44179913, 62974570, 89329823
Offset: 1

Views

Author

Labos Elemer, Jun 17 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a = Table[0, {10^6}]; Do[b = EulerPhi[n]/2; If[b < 10^6 + 1, a[[b]] = 1], {n, 1, 2 10^7}]; b = Select[ Range[10^6], a[[ # ]] == 0 &]; c = 2; Do[ Print[c]; c = b[[c]], {n, 0, 17}]

Formula

a(5) = 373 = 746/2, where 746 is the a(4) = 149th term in A005277.

Extensions

Edited by Robert G. Wilson v, Jun 20 2002
a(18)-a(31) from Donovan Johnson, Oct 29 2010

A260621 Let b(k, n) = number obtained when the map x->A002808(x) is applied k times to n; a(n) is the smallest k such that b(k, n) + 1 is prime.

Original entry on oeis.org

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

Views

Author

Matthew Campbell, Sep 25 2015

Keywords

Comments

a(n) is also the smallest value of k at which b(k, n+1) - b(k, n) > 1.

Examples

			When n = 3, writing Composite(x) for A002808(x):
1. Composite(3) = 8. 8 + 1 = 9 = 3^2. 9 is not prime.
2. Composite(8) = 15. 15 + 1 = 16 = 2^4. 16 is not prime.
3. Composite(15) = 25. 25 + 1 = 26 = 2*13. 26 is not prime.
4. Composite(25) = 38. 38 + 1 = 39 = 3*13. 39 is not prime.
5. Composite(38) = 55. 55 + 1 = 56 = 2^3*7. 56 is not prime.
6. Composite(55) = 77. 77 + 1 = 78 = 2*3*13. 78 is not prime.
7. Composite(77) = 105. 105 + 1 = 106 = 2*53. 106 is not prime.
8. Composite(105) = 140. 140 + 1 = 141 = 3*47. 141 is not prime.
9. Composite(140) = 183. 183 + 1 = 184 = 2^3*23. 184 is not prime.
10. Composite(183) = 235. 235 + 1 = 236 = 2^2*59. 236 is not prime.
11. Composite(235) = 298. 298 + 1 = 299 = 13*23. 299 is not prime.
12. Composite(298) = 372. 372 + 1 = 373. 373 is prime.
--------------------------------------------------------------
Since the composite function was applied 12 times, a(3)=12.
		

Crossrefs

Primes and nonprimes: A000040, A002808, A008578, A018252.
a(1) = p, a(n+1) = a(n)-th composite number: A006508, A022450, A022451, A025010, A025011, A059407, A059408.
Composites with order n > 1: A050435, A050436, A050438, A050439, A050440.
Composites with order n = b, n >= 1: A022449.
Composites with prime subscripts: A065858.
Composites without prime subscripts: A175251.
Order of compositeness: A059981, A236536.
Prime(n)-1: A006093.

Programs

  • Mathematica
    c = Select[Range[10^5], CompositeQ]; Table[k = 1; While[! PrimeQ[Nest[c[[#]] &, n, k] + 1], k++]; k, {n, 120}] (* Michael De Vlieger, Jul 15 2016 *)

Extensions

Terms from a(12) onward from Jon E. Schoenfield, Sep 27 2015

A328661 If n is the k-th composite number then a(n) = a(k), otherwise a(n) = n.

Original entry on oeis.org

1, 2, 3, 1, 5, 2, 7, 3, 1, 5, 11, 2, 13, 7, 3, 1, 17, 5, 19, 11, 2, 13, 23, 7, 3, 1, 17, 5, 29, 19, 31, 11, 2, 13, 23, 7, 37, 3, 1, 17, 41, 5, 43, 29, 19, 31, 47, 11, 2, 13, 23, 7, 53, 37, 3, 1, 17, 41, 59, 5, 61, 43, 29, 19, 31, 47, 67, 11, 2, 13, 71, 23, 73
Offset: 1

Views

Author

Rémy Sigrist, Oct 24 2019

Keywords

Examples

			a(42) = a(28) = a(18) = a(10) = a(5) = 5.
		

Crossrefs

See A288469 and A328018 for similar sequences.

Programs

  • PARI
    k=0; for (n=1, #a=vector(73), print1 (a[n] = if (bigomega(n)>1, a[k++], n) ", "))

Formula

a(n) = 1 iff n belongs to A006508.

A356398 a(1) = 4, and for any n > 1, a(n+1) is the a(n)-th squarefree number.

Original entry on oeis.org

4, 5, 6, 7, 10, 14, 21, 33, 53, 85, 138, 222, 366, 599, 985, 1613, 2651, 4357, 7169, 11795, 19401, 31913, 52487, 86347, 142021, 233615, 384277, 632091, 1039741, 1710305, 2813358, 4627790, 7612435, 12521926, 20597674, 33881799, 55733298, 91677666, 150803687
Offset: 1

Views

Author

Rémy Sigrist, Aug 05 2022

Keywords

Comments

See A071255 for a similar sequence.
The ratio a(n+1)/a(n) tends to Pi^2/6 (A013661) as n tends to infinity.

Examples

			a(1) = 4 and the fourth squarefree number is 5, so a(2) = 5.
		

Crossrefs

Programs

  • C
    See Links section.

Formula

a(n+1) = A005117(a(n)).

A377181 Rectangular array, by antidiagonals: (row 1) = r(1) = A002808 (composite numbers); (row n) = r(n) = A002808(r(n-1)) for n>=1.

Original entry on oeis.org

4, 6, 9, 8, 12, 16, 9, 15, 21, 26, 10, 16, 25, 33, 39, 12, 18, 26, 38, 49, 56, 14, 21, 28, 39, 55, 69, 78, 15, 24, 33, 42, 56, 77, 94, 106, 16, 25, 36, 49, 60, 78, 105, 125, 141, 18, 26, 38, 52, 69, 84, 106, 140, 164, 184, 20, 28, 39, 55, 74, 94, 115, 141, 183, 212, 236
Offset: 1

Views

Author

Clark Kimberling, Oct 19 2024

Keywords

Examples

			 corner:
   4     6     8     9    10    12    14    15    16    18
   9    12    15    16    18    21    24    25    26    28
  16    21    25    26    28    33    36    38    39    42
  26    33    38    39    42    49    52    55    56    60
  39    49    55    56    60    69    74    77    78    84
  56    69    77    78    84    94   100   105   106   115
  78    94   105   106   115   125   133   140   141   152
		

Crossrefs

Cf. A002808 (row 1), A050545 (row 2), A280327 (row 3), A006508 (column 1), A022450 (column 2), A023451 (column 3), A059981, A236356, A280327 (principal diagonal), A377173, A114577 (dispersion of the composite numbers).

Programs

  • Mathematica
    c[n_] := c[n] = Select[Range[500], CompositeQ][[n]]
    r[0] = Table[c[n], {n, 1, 10}]
    r[n_] := r[n] = c[r[n - 1]]
    Grid[Table[r[n], {n, 0, 6}]]  (* array *)
    p[n_, k_] := r[n][[k]];
    Table[p[n - k + 1, k], {n, 0, 9}, {k, n + 1, 1, -1}] // Flatten  (* sequence *)

Formula

A059981(n) = number of appearances of A002808(n).

A065962 a(1) = 1, a(n) = a(n - 1) + pi(a(n - 1)) + 1.

Original entry on oeis.org

1, 2, 4, 7, 12, 18, 26, 36, 48, 64, 83, 107, 136, 169, 209, 256, 311, 376, 451, 539, 639, 755, 889, 1044, 1220, 1420, 1644, 1904, 2196, 2524, 2894, 3313, 3780, 4307, 4898, 5553, 6286, 7104, 8015, 9025, 10147, 11393, 12769, 14293, 15971, 17832
Offset: 1

Views

Author

Labos Elemer, Dec 08 2001

Keywords

Comments

Labos came up with this sequence when trying to write a Mathematica program for A006508. The entire loop "While[ k - PrimePi[ k ] - 1, k++ ]" is meaningless; all the function g[n] really does is add up n + pi(n) + 1 and then NestList makes the recurrence happen. - Alonso del Arte, Oct 25 2011

Examples

			a(4) = 7 because a(3) = 4 and 4 + pi(4) + 1 = 4 + 2 + 1 = 7.
a(5) = 12 because a(4) = 7 and 7 + pi(7) + 1 = 7 + 4 + 1 = 12.
		

Crossrefs

Cf. A000720.

Programs

  • Mathematica
    g[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1, k++ ]; k); NestList[ g, 1, 50 ]
    NestList[#+PrimePi[#]+1&,1,50] (* Harvey P. Dale, Feb 13 2016 *)

A207573 a(1)=1, a(n+1) = prime(a(n)+1) - a(n).

Original entry on oeis.org

1, 2, 3, 4, 7, 12, 29, 84, 355, 2038, 15723, 156920, 1959177, 29788564, 539206155, 11406258536, 277708694711, 7683630307352, 239005572292955, 8281900782667178, 317172995786425445
Offset: 1

Views

Author

Gerasimov Sergey, Feb 19 2012

Keywords

Examples

			a(2) = prime(a(1)+1)-a(1) =  3-1 = 2;
a(3) = prime(a(2)+1)-a(2) =  5-2 = 3;
a(4) = prime(a(3)+1)-a(3) =  7-3 = 4;
a(5) = prime(a(4)+1)-a(4) = 11-4 = 7.
		

Crossrefs

Extensions

a(19)-a(21) from Charles R Greathouse IV, Feb 20 2012
Previous Showing 11-20 of 20 results.