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

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]

A049076 Number of steps in the prime index chain for the n-th prime.

Original entry on oeis.org

1, 2, 3, 1, 4, 1, 2, 1, 1, 1, 5, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 6, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Let p(k) = k-th prime, let S(p) = S(p(k)) = k, the subscript of p; a(n) = order of primeness of p(n) = 1+m where m is largest number such that S(S(..S(p(n))...)) with m S's is a prime.
The record holders correspond to A007097.

Examples

			11 is 5th prime, so S(11)=5, 5 is 3rd prime, so S(S(11))=3, 3 is 2nd prime, so S(S(S(11)))=2, 2 is first prime, so S(S(S(S(11))))=1, not a prime. Thus a(5)=4.
Alternatively, a(5) = 4: the 5th prime is 11 and its prime index chain is 11->5->3->2->1->0. a(6) = 1: the 6th prime is 13 and its prime index chain is 13->6->0.
		

Crossrefs

Programs

  • Haskell
    a049076 = (+ 1) . a078442  -- Reinhard Zumkeller, Jul 14 2013
  • Maple
    A049076 := proc(n)
        if not isprime(n) then
            1 ;
        else
            1+procname(numtheory[pi](n)) ;
        end if;
    end proc:
    seq(A049076(n),n=1..30) ; # R. J. Mathar, Jan 28 2014
  • Mathematica
    A049076 f[n_] := Length[ NestWhileList[ PrimePi, n, PrimeQ]]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Mar 11 2004 *)
    Table[Length[NestWhileList[PrimePi[#]&,Prime[n],PrimeQ[#]&]]-1,{n,110}] (* Harvey P. Dale, May 07 2018 *)
  • PARI
    apply(p->my(s=1);while(isprime(p=primepi(p)),s++); s, primes(100)) \\ Charles R Greathouse IV, Nov 20 2012
    

Formula

Let b(n) = 0 if n is nonprime, otherwise b(n) = k where n is the k-th prime. Then a(n) is the number of times you can apply b to the n-th prime before you hit a nonprime.
a(n) = 1 + A078442(n). - R. J. Mathar, Jul 07 2012
a(n) = A078442(A000040(n)). - Alois P. Heinz, Mar 16 2020

Extensions

Additional comments from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 12 2003

A290822 Transitive numbers: Matula-Goebel numbers of transitive rooted trees.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 16, 18, 24, 28, 30, 32, 36, 38, 42, 48, 54, 56, 60, 64, 72, 76, 78, 84, 90, 96, 98, 106, 108, 112, 114, 120, 126, 128, 138, 144, 150, 152, 156, 162, 168, 180, 192, 196, 210, 212, 216, 222, 224, 228, 234, 238, 240, 252, 256, 262, 266, 270
Offset: 1

Views

Author

Gus Wiseman, Oct 19 2017

Keywords

Comments

A number x is transitive if whenever prime(y) divides x and prime(z) divides y, we have prime(z) divides x.

Examples

			The sequence of transitive rooted trees begins:
1  o
2  (o)
4  (oo)
6  (o(o))
8  (ooo)
12 (oo(o))
14 (o(oo))
16 (oooo)
18 (o(o)(o))
24 (ooo(o))
28 (oo(oo))
30 (o(o)((o)))
32 (ooooo)
36 (oo(o)(o))
38 (o(ooo))
42 (o(o)(oo))
48 (oooo(o))
54 (o(o)(o)(o))
56 (ooo(oo))
60 (oo(o)((o)))
64 (oooooo)
72 (ooo(o)(o))
76 (oo(ooo))
78 (o(o)(o(o)))
84 (oo(o)(oo))
90 (o(o)(o)((o)))
96 (ooooo(o))
98 (o(oo)(oo))
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    subprimes[n_]:=If[n===1,{},Union@@Cases[FactorInteger[n],{p_,_}:>FactorInteger[PrimePi[p]][[All,1]]]];
    Select[Range[270],Divisible[#,Times@@subprimes[#]]&]

A109082 Depth of rooted tree having Matula-Goebel number n.

Original entry on oeis.org

0, 1, 2, 1, 3, 2, 2, 1, 2, 3, 4, 2, 3, 2, 3, 1, 3, 2, 2, 3, 2, 4, 3, 2, 3, 3, 2, 2, 4, 3, 5, 1, 4, 3, 3, 2, 3, 2, 3, 3, 4, 2, 3, 4, 3, 3, 4, 2, 2, 3, 3, 3, 2, 2, 4, 2, 2, 4, 4, 3, 3, 5, 2, 1, 3, 4, 3, 3, 3, 3, 4, 2, 3, 3, 3, 2, 4, 3, 5, 3, 2, 4, 4, 2, 3, 3, 4, 4, 3, 3, 3, 3, 5, 4, 3, 2, 4, 2, 4, 3
Offset: 1

Views

Author

Keith Briggs, Aug 17 2005

Keywords

Comments

Another term for depth is height.
Starting with n, a(n) is the number of times one must take the product of prime indices (A003963) to reach 1. - Gus Wiseman, Mar 27 2019

Examples

			a(7) = 2 because the rooted tree with Matula-Goebel number 7 is the 3-edge rooted tree Y of height 2.
		

Crossrefs

A left inverse of A007097.
Cf. A000081, A000720, A001222, A109129, A112798, A196050, A290822, A317713, A320325, A324927 (positions of 2), A324928 (positions of 3), A325032.
This statistic is counted by A034781, ordered A080936.
The ordered version is A358379.
For node-height instead of edge-height we have A358552.

Programs

  • Maple
    with(numtheory): a := proc(n) option remember; if n = 1 then 0 elif isprime(n) then 1+a(pi(n)) else max((map (p->a(p), factorset(n)))[]) end if end proc: seq(a(n), n = 1 .. 100); # Emeric Deutsch, Sep 16 2011
  • Mathematica
    a [n_] := a[n] = If[n == 1, 0, If[PrimeQ[n], 1+a[PrimePi[n]], Max[Map[a, FactorInteger[n][[All, 1]]]]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, May 06 2014, after Emeric Deutsch *)
  • PARI
    a(n) = my(v=factor(n)[,1],d=0); while(#v,d++; v=fold(setunion, apply(p->factor(primepi(p))[,1]~, v))); d; \\ Kevin Ryde, Sep 21 2020
    
  • Python
    from functools import lru_cache
    from sympy import isprime, primepi, primefactors
    @lru_cache(maxsize=None)
    def A109082(n):
        if n == 1 : return 0
        if isprime(n): return 1+A109082(primepi(n))
        return max(A109082(p) for p in primefactors(n)) # Chai Wah Wu, Mar 19 2022

Formula

a(1)=0; if n is the t-th prime, then a(n) = 1 + a(t); if n is composite, n=t*s, then a(n) = max(a(t),a(s)). The Maple program is based on this.
a(A007097(n)) = n.
a(n) = A358552(n) - 1. - Gus Wiseman, Nov 27 2022

Extensions

Edited by Emeric Deutsch, Sep 16 2011

A324695 Lexicographically earliest sequence of positive integers whose prime indices are not already in the sequence.

Original entry on oeis.org

1, 3, 7, 9, 11, 13, 19, 21, 27, 29, 33, 37, 39, 43, 47, 49, 53, 57, 59, 61, 63, 71, 77, 79, 81, 83, 87, 89, 91, 97, 99, 101, 107, 111, 113, 117, 121, 127, 129, 131, 133, 139, 141, 143, 147, 149, 151, 159, 163, 169, 171, 173, 177, 179, 181, 183, 189, 193, 197
Offset: 1

Views

Author

Gus Wiseman, Mar 10 2019

Keywords

Comments

A self-describing sequence, similar to A304360.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with their prime indices begins:
   1: {}
   3: {2}
   7: {4}
   9: {2,2}
  11: {5}
  13: {6}
  19: {8}
  21: {2,4}
  27: {2,2,2}
  29: {10}
  33: {2,5}
  37: {12}
  39: {2,6}
  43: {14}
  47: {15}
  49: {4,4}
  53: {16}
  57: {2,8}
  59: {17}
  61: {18}
  63: {2,2,4}
		

Crossrefs

Programs

  • Mathematica
    aQ[n_]:=And@@Cases[If[n==1,{},FactorInteger[n]],{p_,k_}:>!aQ[PrimePi[p]]];
    Select[Range[100],aQ]

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

A291636 Matula-Goebel numbers of lone-child-avoiding rooted trees.

Original entry on oeis.org

1, 4, 8, 14, 16, 28, 32, 38, 49, 56, 64, 76, 86, 98, 106, 112, 128, 133, 152, 172, 196, 212, 214, 224, 256, 262, 266, 301, 304, 326, 343, 344, 361, 371, 392, 424, 428, 448, 454, 512, 524, 526, 532, 602, 608, 622, 652, 686, 688, 722, 742, 749, 766, 784, 817
Offset: 1

Views

Author

Gus Wiseman, Aug 28 2017

Keywords

Comments

We say that a rooted tree is lone-child-avoiding if no vertex has exactly one child.
The Matula-Goebel number of a rooted tree is the product of primes indexed by the Matula-Goebel numbers of its branches. This gives a bijective correspondence between positive integers and unlabeled rooted trees.
An alternative definition: n is in the sequence iff n is 1 or the product of two or more not necessarily distinct prime numbers whose prime indices already belong to the sequence. For example, 14 is in the sequence because 14 = prime(1) * prime(4) and 1 and 4 both already belong to the sequence.

Examples

			The sequence of all lone-child-avoiding rooted trees together with their Matula-Goebel numbers begins:
    1: o
    4: (oo)
    8: (ooo)
   14: (o(oo))
   16: (oooo)
   28: (oo(oo))
   32: (ooooo)
   38: (o(ooo))
   49: ((oo)(oo))
   56: (ooo(oo))
   64: (oooooo)
   76: (oo(ooo))
   86: (o(o(oo)))
   98: (o(oo)(oo))
  106: (o(oooo))
  112: (oooo(oo))
  128: (ooooooo)
  133: ((oo)(ooo))
  152: (ooo(ooo))
  172: (oo(o(oo)))
		

Crossrefs

These trees are counted by A001678.
The case with more than two branches is A331490.
Unlabeled rooted trees are counted by A000081.
Topologically series-reduced rooted trees are counted by A001679.
Labeled lone-child-avoiding rooted trees are counted by A060356.
Labeled lone-child-avoiding unrooted trees are counted by A108919.
MG numbers of singleton-reduced rooted trees are A330943.
MG numbers of topologically series-reduced rooted trees are A331489.

Programs

  • Mathematica
    nn=2000;
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    srQ[n_]:=Or[n===1,With[{m=primeMS[n]},And[Length[m]>1,And@@srQ/@m]]];
    Select[Range[nn],srQ]

Extensions

Updated with corrected terminology by Gus Wiseman, Jan 20 2020

A111299 Numbers whose Matula tree is a binary tree (i.e., root has degree 2 and all nodes except root and leaves have degree 3).

Original entry on oeis.org

4, 14, 49, 86, 301, 454, 886, 1589, 1849, 3101, 3986, 6418, 9761, 13766, 13951, 19049, 22463, 26798, 31754, 48181, 51529, 57026, 75266, 85699, 93793, 100561, 111139, 128074, 137987, 196249, 199591, 203878, 263431, 295969, 298154, 302426, 426058, 448259, 452411
Offset: 1

Views

Author

Keith Briggs, Nov 02 2005

Keywords

Comments

This sequence should probably start with 1. Then a number k is in the sequence iff k = 1 or k = prime(x) * prime(y) with x and y already in the sequence. - Gus Wiseman, May 04 2021

Examples

			From _Gus Wiseman_, May 04 2021: (Start)
The sequence of trees (starting with 1) begins:
     1: o
     4: (oo)
    14: (o(oo))
    49: ((oo)(oo))
    86: (o(o(oo)))
   301: ((oo)(o(oo)))
   454: (o((oo)(oo)))
   886: (o(o(o(oo))))
  1589: ((oo)((oo)(oo)))
  1849: ((o(oo))(o(oo)))
  3101: ((oo)(o(o(oo))))
  3986: (o((oo)(o(oo))))
  6418: (o(o((oo)(oo))))
  9761: ((o(oo))((oo)(oo)))
(End)
		

Crossrefs

Cf. A245824 (by number of leaves).
These trees are counted by 2*A001190 - 1.
The semi-binary version is A292050 (counted by A001190).
The semi-identity case is A339193 (counted by A063895).
A000081 counts unlabeled rooted trees with n nodes.
A007097 ranks rooted chains.
A276625 ranks identity trees, counted by A004111.
A306202 ranks semi-identity trees, counted by A306200.
A306203 ranks balanced semi-identity trees, counted by A306201.
A331965 ranks lone-child avoiding semi-identity trees, counted by A331966.

Programs

  • Mathematica
    nn=20000;
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    binQ[n_]:=Or[n===1,With[{m=primeMS[n]},And[Length[m]===2,And@@binQ/@m]]];
    Select[Range[2,nn],binQ] (* Gus Wiseman, Aug 28 2017 *)
  • PARI
    i(n)=n==2 || is(primepi(n))
    is(n)=if(n<14,return(n==4)); my(f=factor(n),t=#f[,1]); if(t>1, t==2 && f[1,2]==1 && f[2,2]==1 && i(f[1,1]) && i(f[2,1]), f[1,2]==2 && i(f[1,1])) \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, if(i(p)&&i(q), listput(v, t*q)))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    \\ Also see links.

Formula

The Matula tree of k is defined as follows:
matula(k):
create a node labeled k
for each prime factor m of k:
add the subtree matula(prime(m)), by an edge labeled m
return the node

Extensions

Definition corrected by Charles R Greathouse IV, Mar 29 2013
a(27)-a(39) from Charles R Greathouse IV, Mar 29 2013

A303431 Aperiodic tree numbers. Matula-Goebel numbers of aperiodic rooted trees.

Original entry on oeis.org

1, 2, 3, 5, 6, 10, 11, 12, 13, 15, 18, 20, 22, 24, 26, 29, 30, 31, 33, 37, 39, 40, 41, 44, 45, 47, 48, 50, 52, 54, 55, 58, 60, 61, 62, 65, 66, 71, 72, 74, 75, 78, 79, 80, 82, 87, 88, 89, 90, 93, 94, 96, 99, 101, 104, 108, 109, 110, 111, 113, 116, 117, 120, 122
Offset: 1

Views

Author

Gus Wiseman, Apr 23 2018

Keywords

Comments

A positive integer is an aperiodic tree number iff either it is equal to 1 or it belongs to A007916 (numbers that are not perfect powers, or numbers whose prime multiplicities are relatively prime) and all of its prime indices are also aperiodic tree numbers, where a prime index of n is a number m such that prime(m) divides n.

Examples

			Sequence of aperiodic rooted trees begins:
01 o
02 (o)
03 ((o))
05 (((o)))
06 (o(o))
10 (o((o)))
11 ((((o))))
12 (oo(o))
13 ((o(o)))
15 ((o)((o)))
18 (o(o)(o))
20 (oo((o)))
22 (o(((o))))
24 (ooo(o))
26 (o(o(o)))
29 ((o((o))))
30 (o(o)((o)))
31 (((((o)))))
33 ((o)(((o))))
		

Crossrefs

Programs

  • Mathematica
    zapQ[1]:=True;zapQ[n_]:=And[GCD@@FactorInteger[n][[All,2]]===1,And@@zapQ/@PrimePi/@FactorInteger[n][[All,1]]];
    Select[Range[100],zapQ]

A324694 Lexicographically earliest sequence of positive integers divisible by prime(m) for some m not already in the sequence.

Original entry on oeis.org

2, 4, 5, 6, 8, 10, 12, 14, 15, 16, 17, 18, 20, 22, 23, 24, 25, 26, 28, 30, 31, 32, 34, 35, 36, 38, 40, 41, 42, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 58, 60, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 78, 80, 82, 84, 85, 86, 88, 90, 92, 93, 94, 95
Offset: 1

Views

Author

Gus Wiseman, Mar 10 2019

Keywords

Comments

A self-describing sequence, similar to A304360.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with their prime indices begins:
   2: {1}
   4: {1,1}
   5: {3}
   6: {1,2}
   8: {1,1,1}
  10: {1,3}
  12: {1,1,2}
  14: {1,4}
  15: {2,3}
  16: {1,1,1,1}
  17: {7}
  18: {1,2,2}
  20: {1,1,3}
  22: {1,5}
  23: {9}
  24: {1,1,1,2}
  25: {3,3}
  26: {1,6}
  28: {1,1,4}
  30: {1,2,3}
		

Crossrefs

Programs

  • Mathematica
    aQ[n_]:=!And@@Cases[If[n==1,{},FactorInteger[n]],{p_,k_}:>aQ[PrimePi[p]]];
    Select[Range[100],aQ]
Previous Showing 11-20 of 284 results. Next