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.

Showing 1-8 of 8 results.

A114537 Dispersion of the primes (an array read by downward antidiagonals).

Original entry on oeis.org

1, 2, 4, 3, 7, 6, 5, 17, 13, 8, 11, 59, 41, 19, 9, 31, 277, 179, 67, 23, 10, 127, 1787, 1063, 331, 83, 29, 12, 709, 15299, 8527, 2221, 431, 109, 37, 14, 5381, 167449, 87803, 19577, 3001, 599, 157, 43, 15, 52711, 2269733, 1128889, 219613, 27457, 4397, 919, 191, 47
Offset: 1

Views

Author

Clark Kimberling, Dec 07 2005

Keywords

Comments

A number is prime if and only if it does not lie in Column 1. As a sequence, a permutation of the natural numbers. The fractal sequence of this dispersion is A022447 and the transposition sequence is A114538.
The dispersion of the composite numbers is given at A114577.

Examples

			Northwest corner of the Primeness array:
1   2   3    5    11     31     127       709       5381       52711        648391
4   7  17   59   277   1787   15299    167449    2269733    37139213     718064159
6  13  41  179  1063   8527   87803   1128889   17624813   326851121    7069067389
8  19  67  331  2221  19577  219613   3042161   50728129   997525853   22742734291
9  23  83  431  3001  27457  318211   4535189   77557187  1559861749   36294260117
10  29 109  599  4397  42043  506683   7474967  131807699  2724711961   64988430769
12  37 157  919  7193  72727  919913  14161729  259336153  5545806481  136395369829
14  43 191 1153  9319  96797 1254739  19734581  368345293  8012791231  200147986693
15  47 211 1297 10631 112129 1471343  23391799  440817757  9672485827  243504973489
16  53 241 1523 12763 137077 1828669  29499439  563167303 12501968177  318083817907
18  61 283 1847 15823 173867 2364361  38790341  751783477 16917026909  435748987787
20  71 353 2381 21179 239489 3338989  56011909 1107276647 25366202179  664090238153
21  73 367 2477 22093 250751 3509299  59053067 1170710369 26887732891  705555301183
22  79 401 2749 24859 285191 4030889  68425619 1367161723 31621854169  835122557939
24  89 461 3259 30133 352007 5054303  87019979 1760768239 41192432219 1099216100167
25  97 509 3637 33967 401519 5823667 101146501 2062666783 48596930311 1305164025929
26 101 547 3943 37217 443419 6478961 113256643 2323114841 55022031709 1484830174901
27 103 563 4091 38833 464939 6816631 119535373 2458721501 58379844161 1579041544637
		

References

  • Alexandrov, Lubomir. "On the nonasymptotic prime number distribution." arXiv preprint math/9811096 (1998). (See Appendix.)
  • Clark Kimberling, "Fractal sequences and interspersions," Ars Combinatoria, 45 (1997) 157-168.

Crossrefs

Diagonal: A181441.
If the antidiagonals are read in the opposite direction we get A138947.

Programs

  • Maple
    A114537 := proc(r,c) option remember; if c = 1 then A018252(r) ; else ithprime(procname(r,c-1)) ; end if; end proc: # R. J. Mathar, Oct 22 2010
  • Mathematica
    NonPrime[n_] := FixedPoint[n + PrimePi@# + 1 &, n]; t[n_, k_] := Nest[Prime, NonPrime[n], k]; Table[ t[n - k, k], {n, 0, 9}, {k, n, 0, -1}] // Flatten
    (* or to view the table *) Table[t[n, k], {n, 0, 6}, {k, 0, 10}] // TableForm (* Robert G. Wilson v, Dec 26 2005 *)

Formula

T(r,1) = A018252(r). T(r,c) = prime(T(r,c-1)), c>1. [R. J. Mathar, Oct 22 2010]

A114538 Transposition sequence of the dispersion of the primes.

Original entry on oeis.org

1, 4, 6, 2, 8, 3, 7, 5, 11, 31, 9, 127, 17, 709, 5381, 52711, 13, 648391, 59, 9737333, 174440041, 3657500101, 277, 88362852307, 2428095424619, 75063692618249, 2586559730396077
Offset: 1

Views

Author

Clark Kimberling, Dec 07 2005

Keywords

Comments

A self-inverse permutation of the positive integers.

Examples

			Start with the northwest corner of T:
1 2 3 5 11 31 127 709 5381 52711 648391
4 7 17 59 277 1787 15299 167449 2269733 37139213 718064159
6 13 41 179 1063 8527 87803 1128889 17624813 326851121 7069067389
8 19 67 331 2221 19577 219613 3042161 50728129 997525853 22742734291
9 23 83 431 3001 27457 319211 4535189 77557187 1559861749 36294260117
10 29 109 599 4397 42043 506683 7474967 131807699 2824711961 64988430769
12 37 157 919 7193 72727 919913 14161729 259336153 5545806481 136395369829
a(1)=1 because 1=T(1,1) and T(1,1)=1.
a(2)=4 because 2=T(1,2) and T(2,1)=4.
a(3)=6 because 3=T(1,3) and T(3,1)=6.
a(13)=17 because 13=T(3,2) and T(2,3)=17.
		

Crossrefs

Cf. A114537.
Columns 1-6 above: A018252, A007821, A049078, A049079, A049080, A049081.

Formula

Suppose T is a rectangular array consisting of positive integers, each exactly once. The transposition sequence of T is here defined by placing T(i, j) in position T(j, i) for all i and j.

Extensions

a(22)-a(27) from Robert G. Wilson v, Dec 24 2005

A250251 Fixed points of A250249 and A250250.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 56, 58, 59, 60, 61, 62, 64, 67, 68, 70, 71, 72, 74, 76, 77, 79, 80, 82, 83, 86, 88, 89, 92, 94, 96, 97, 98, 100, 101, 104, 106, 107, 109, 112, 113, 116, 118, 120, 121
Offset: 1

Views

Author

Antti Karttunen, Nov 18 2014

Keywords

Comments

Numbers for which A250249(n) = n (equally: A250250(n) = n).
If n is a member, then 2n is also a member. If any 2n is a member, then n is also a member. If n is a member, then the n-th prime, p_n (= A000040(n)) is also a member. If p_n is a member, then its index n is also a member. Thus the sequence is completely determined by its odd nonprime terms: 1, 9, 15, 25, ..., (A249730) and is obtained as a union of their multiples with powers of 2, and all prime recurrences that start with those values: A007097 U A057450 U A057451 U A057452 U A057453 U ..., etc.

Crossrefs

Complement: A249729.
Subsequences: A249730, and also A007097, A057450, A057451, A057452, A057453, etc.
Cf. also A245823, A250249, A250250.

A138947 Square array T[i+1,j] = prime(T[i,j]), T[1,j] = j-th nonprime = A018252(j); read by upward antidiagonals.

Original entry on oeis.org

1, 4, 2, 6, 7, 3, 8, 13, 17, 5, 9, 19, 41, 59, 11, 10, 23, 67, 179, 277, 31, 12, 29, 83, 331, 1063, 1787, 127, 14, 37, 109, 431, 2221, 8527, 15299, 709, 15, 43, 157, 599, 3001, 19577, 87803
Offset: 1

Views

Author

M. F. Hasler, Apr 28 2008

Keywords

Comments

For i>1, T[i,j] = A018252(j)-th number among those not occurring in rows < i.
A permutation of the integers > 0.
Transpose of A114537. See that sequence and the link for more information and references.

Examples

			The first row (1,4,6,8,9,10...) of the array gives the nonprime numbers A018252.
The 2nd row (2,7,13,19,23,29,37,...) of the array gives the primes with nonprime index, A000040(A018252(j)) = A007821(j).
The i-th row is { A000040(k) | A049076(k)=i-1 } = A078442^{-1}(i-1).
Column j is the sequence b(n+1)=prime(b(n)) starting with b(j)=A018252(j): A007097, A057450, A057451, A057452, A057453, A057456, A057457, ...
		

References

  • Alexandrov, Lubomir. "On the nonasymptotic prime number distribution." arXiv preprint math/9811096 (1998). (See Appendix.)

Crossrefs

If the antidiagonals are read in the opposite direction we get A114537.

Programs

  • Mathematica
    t[1, 1] = 1; t[1, 2] = 4; t[1, k_] := (p = t[1, k-1]; If[ PrimeQ[p+1], p+2, p+1]); t[n_ /; n > 1, k_] := Prime[t[n-1, k]]; Flatten[ Table[ t[n, k-n+1], {k, 1, 9}, {n, 1, k}]] (* Jean-François Alcover, Oct 03 2011 *)
  • PARI
    p=c=0; T=matrix( 10,10, i,j, if( i==1, while( isprime(c++),); p=c, p=prime(p))); A138947=concat( vector( vecmin( matsize( T )),i, vector( i,j, T[ j,i+1-j ])))

Formula

T[i,j] = j-th number for which A078442 equals i-1.

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

A098383 Define a function f on the positive integers by: if n is 1 or composite, stop; but if n = prime(k) then f(n) = k; a(n) = sum of terms in trajectory of n under repeated application of f.

Original entry on oeis.org

1, 3, 6, 4, 11, 6, 11, 8, 9, 10, 22, 12, 19, 14, 15, 16, 28, 18, 27, 20, 21, 22, 32, 24, 25, 26, 27, 28, 39, 30, 53, 32, 33, 34, 35, 36, 49, 38, 39, 40, 60, 42, 57, 44, 45, 46, 62, 48, 49, 50, 51, 52, 69, 54, 55, 56, 57, 58, 87, 60, 79, 62, 63, 64, 65, 66, 94, 68, 69, 70, 91, 72
Offset: 1

Views

Author

Andrew S. Plewe, Oct 26 2004

Keywords

Comments

Sum of the terms in the prime index chain for n (cf. A049076).

Examples

			a(2) = 3 because 2 is the first prime, therefore 2 + 1 = 3. a(3) = 6 because 3 is the second prime and two is the first prime, therefore 3 + 2 + 1 = 6. a(4) = 4 because 4 is composite. a(5) = 11 because five is the third prime, three is the second prime and two is the first prime, which gives us 5 + 3 + 2 + 1 = 11 and so on.
		

Crossrefs

Programs

  • Maple
    a:= n-> n + `if`(isprime(n), a(numtheory[pi](n)), 0):
    seq (a(n), n=1..80);  # Alois P. Heinz, Jul 16 2012
  • Mathematica
    Table[s=n; p=n; While[PrimeQ[p], p=PrimePi[p]; s=s+p]; s, {n, 1000}] (T. D. Noe)

Extensions

More terms from Ray Chandler, Nov 04 2004

A354967 Square array A(n, k), n > 0, k >= 0, read by antidiagonals upwards; A(n, k) is the image of n after k iterates of the prime function (A000040).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 5, 7, 11, 11, 11, 6, 11, 17, 31, 31, 31, 7, 13, 31, 59, 127, 127, 127, 8, 17, 41, 127, 277, 709, 709, 709, 9, 19, 59, 179, 709, 1787, 5381, 5381, 5381, 10, 23, 67, 277, 1063, 5381, 15299, 52711, 52711, 52711, 11, 29, 83, 331, 1787, 8527, 52711, 167449, 648391, 648391, 648391
Offset: 1

Views

Author

Rémy Sigrist, Jun 14 2022

Keywords

Comments

For any m > 0, m appears A049076(m) times in the array.

Examples

			Array A(n, k) begins:
  n\k|  0   1   2    3     4      5       6        7         8
  ---+--------------------------------------------------------
    1|  1   2   3    5    11     31     127      709      5381
    2|  2   3   5   11    31    127     709     5381     52711
    3|  3   5  11   31   127    709    5381    52711    648391
    4|  4   7  17   59   277   1787   15299   167449   2269733
    5|  5  11  31  127   709   5381   52711   648391   9737333
    6|  6  13  41  179  1063   8527   87803  1128889  17624813
    7|  7  17  59  277  1787  15299  167449  2269733  37139213
    8|  8  19  67  331  2221  19577  219613  3042161  50728129
		

Crossrefs

Programs

  • PARI
    A(n,k) = { my (v=n); for (i=1, k, v=prime(v)); return (v) }

Formula

A(n, 0) = n.
A(n, k+1) = A000040(A(n, k)).
A(n, n) = A058009(n).
A(n, A000040(n)) = A344946(n).
A(n, 1) = A000040(n).
A(n, 2) = A006450(n).
A(n, 3) = A038580(n).
A(1, k) = A007097(k).
A(4, k) = A057450(k+1).
A(6, k) = A057451(k+1).
A(8, k) = A057452(k+1).
A(9, k) = A057453(k+1).
Showing 1-8 of 8 results.