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-6 of 6 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]

A022328 Exponent of 2 (value of i) in n-th number of form 2^i*3^j, i >= 0, j >= 0 (see A003586).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

From Clark Kimberling, Mar 18 2015 and May 21 2015: (Start)
This is the signature sequence of log(3)/log(2) and is a fractal sequence; e.g., if the first occurrence of each n is removed, the resulting sequence is the original sequence.
Moreover, if the sequence is partitioned into segments starting with 0 as follows:
0,1
0,2,1,3
0,2,4,1,3
0,5,2,4,1,6,3,
and so on, then deleting the greatest number in each segment leaves
0
0,2,1
0,2,1,3
0,5,2,4,1,3,
and so on, which, concatenated to (0,0,2,1,0,2,1,3,0,5,2,4,1,3,...), is another fractal sequence, in today's usual meaning of that term. When introduced in 1995, one of the defining properties of a fractal sequence was, essentially, that before each n appears, every k < n must have already appeared; this requirement ensures that the sequence yields a dispersion; e.g., A114577 yields A114537. However, the usual meaning of "fractal sequence" nowadays is simply "a sequence that contains itself as a proper subsequence". It is proposed here that the original version be renamed "strongly fractal". Thus, the operations called upper trimming and lower trimming (e.g., A084531, A167237), when applied to strongly fractal sequences, yield strongly fractal sequences. The operation introduced here, which can be called "segment-upper trimming", carries fractal sequences to fractal sequences, but not strongly fractal to strongly fractal.
Associated with the signature sequence S of each positive irrational number is an interspersion (or equivalently, a dispersion), in which row n >= 0 consists of the positions of n in S. The interspersion associated with the signature sequence of log(3)/log(2) is A255975.
(End)
Comment from Allan C. Wechsler, May 26 2024 (Start):
More generally, the "signature sequence" of an irrational number H can be defined as follows. Consider all the numbers of the form a + bH, where a and b are positive integers, and sort them into increasing order (there are no cluster points or other obstacles). The sequence of a-values is then the *signature sequence of H.
If the coefficients a and b are allowed to be 0, you get the same sequence but with all the entries decremented by 1.
(End)
a(n) = A069352(n) - A022329(n). - Reinhard Zumkeller, May 16 2015

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a022328 n = a022328_list !! (n-1)
    (a022328_list, a022329_list) = unzip $ f $ singleton (1, (0, 0)) where
       f s = (i, j) :
             f (insert (2 * y, (i + 1, j)) $ insert (3 * y, (i, j + 1)) s')
             where ((y, (i, j)), s') = deleteFindMin s
    -- Reinhard Zumkeller, Nov 19 2015, May 16 2015
    
  • Mathematica
    t = Sort[Flatten[Table[2^i 3^j, {i, 0, 200}, {j, 0, 200}]]];
    Table[IntegerExponent[t[[n]], 2], {n, 1, 200}]  (* A022338 *)
    (* Clark Kimberling, Mar 18 2015 *)
  • Python
    from sympy import integer_log
    def A022328(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum((x//3**i).bit_length() for i in range(integer_log(x,3)[0]+1))
        return (~(m:=bisection(f,n,n))&m-1).bit_length() # Chai Wah Wu, Sep 15 2024

Formula

a(n) = A191475(n) - 1. - Franklin T. Adams-Watters, Mar 19 2009 [Corrected by N. J. A. Sloane, May 26 2024]
A003586(n) = 2^a(n)*3^A022329(n). - N. J. A. Sloane, Mar 19 2009

A022447 Fractal sequence of the dispersion of the primes.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 4, 5, 6, 1, 7, 3, 8, 9, 10, 2, 11, 4, 12, 13, 14, 5, 15, 16, 17, 18, 19, 6, 20, 1, 21, 22, 23, 24, 25, 7, 26, 27, 28, 3, 29, 8, 30, 31, 32, 9, 33, 34, 35, 36, 37, 10, 38, 39, 40, 41, 42, 2, 43, 11, 44, 45, 46, 47, 48, 4, 49, 50, 51, 12, 52, 13, 53, 54, 55, 56, 57, 14
Offset: 1

Views

Author

Keywords

Examples

			From _Sean A. Irvine_, May 20 2019: (Start)
The prime counting function, pi(n), is iterated (possibly zero times) until a nonprime is reached.  If the result of this iteration is m, then a(n) = m - pi(m).  Examples:
n=11: pi(11)=5, pi(5)=3, pi(3)=2, pi(2)=1. Hence, m=1 and so a(11) = 1-pi(1) = 1.
n=12: is already nonprime, hence m=12 and so a(12) = 12-pi(12) = 7.
n=13: pi(13)=6 (a nonprime), hence m=6 and so a(13) = 6-pi(6) = 3.
(End)
		

References

  • C. Kimberling, Fractal sequences and interspersions, Ars Combinatoria, vol. 45, p. 157, 1997.

Crossrefs

Programs

  • Mathematica
    m = 30; list = Table[Length[NestWhileList[PrimePi, n, PrimeQ]], {n, m}]; Table[Length@Position[Take[list, k], list[[k]]], {k, Length[list]}] (* Birkas Gyorgy, Apr 04 2011 *)
    primefractal[n_]:= (# - PrimePi[#]) &@NestWhile[PrimePi, n, PrimeQ]; Array[primefractal, 30] (* Birkas Gyorgy, Apr 04 2011 *)

Extensions

Terms a(67) onward added by G. C. Greubel, Feb 28 2018
Offset corrected by Sean A. Irvine, May 20 2019

A114578 Transposition sequence of the dispersion of the composite numbers.

Original entry on oeis.org

1, 4, 9, 2, 16, 6, 26, 12, 3, 21, 39, 8, 56, 33, 15, 5, 78, 25, 106, 49, 10, 69, 141, 38, 18, 7, 94, 28, 184, 125, 236, 55, 14, 77, 164, 42, 296, 24, 11, 105, 356, 36, 416, 212, 140, 270, 476, 60, 20, 84, 183, 52, 536, 330, 32, 13, 115, 390, 596, 48, 656, 450, 235
Offset: 1

Views

Author

Clark Kimberling, Dec 09 2005

Keywords

Comments

A self-inverse permutation of the positive integers.

Examples

			Start with the northwest corner of T:
1 4 9 16 26
2 6 12 21 33
3 8 15 25 38
5 10 18 28 42
a(1)=1 because 1=T(1,1) and T(1,1)=1.
a(2)=4 because 2=T(2,1) and T(1,2)=4.
a(3)=9 because 3=T(3,1) and T(1,3)=9.
a(10)=21 because 10=T(4,2) and T(2,4)=21.
		

Crossrefs

Cf. A114577.

Formula

Suppose (as at A114538) that T is a rectangular array consisting of all the positive integers, each exactly once. The transposition sequence of T is obtained by placing T(i, j) in position T(j, i) for all i and j.

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).

A361876 Dispersion of the odd primes: a rectangular array read by downward antidiagonals.

Original entry on oeis.org

1, 3, 2, 7, 5, 4, 19, 13, 11, 6, 71, 43, 37, 17, 8, 359, 193, 163, 61, 23, 9, 2423, 1181, 971, 293, 89, 29, 10, 21589, 9547, 7669, 1931, 463, 113, 31, 12, 244481, 99523, 78101, 16699, 3301, 619, 131, 41, 14, 3413801, 1292831, 994559, 184463, 30593, 4583, 743
Offset: 1

Views

Author

Clark Kimberling, Apr 08 2023

Keywords

Comments

Every positive integer occurs exactly once. As a dispersion, the array is also an interspersion. Column 1 consists of 1, 2, and the composite positive integers. Row 2 is essentially A119533.

Examples

			Corner:
   1     3     7    19    71   359 ...
   2     5    13    43   193  1181 ...
   4    11    37   163   971  7669 ...
   6    17    61   293  1931 16699 ...
   8    23    89   463  3301 30593 ...
   9    29   113   619  4583 44041 ...
  10    31   131   743  5653 55711 ...
  12    41   181  1091  8753 90403 ...
  ...
		

Crossrefs

Cf. A000040, A065091, A114537 (dispersion of the primes), A114577 (dispersion of the composite numbers).

Programs

  • Mathematica
    t = Map[NestWhileList[Prime[1 + #] &, #, # < 20000000 &, 1, Infinity, -1] &,
       Complement[Range[Last[#]], #] &[Prime[Range[2, 1000]]]];
    Grid[Take[t, 15]]  (* Peter J. C. Moses, Apr 06 2023 *)
Showing 1-6 of 6 results.