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

A075195 Jablonski table T(n,k) read by antidiagonals: T(n,k) = number of necklaces with n beads of k colors.

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 6, 4, 1, 5, 10, 11, 6, 1, 6, 15, 24, 24, 8, 1, 7, 21, 45, 70, 51, 14, 1, 8, 28, 76, 165, 208, 130, 20, 1, 9, 36, 119, 336, 629, 700, 315, 36, 1, 10, 45, 176, 616, 1560, 2635, 2344, 834, 60, 1, 11, 55, 249, 1044, 3367, 7826, 11165, 8230, 2195, 108, 1
Offset: 1

Views

Author

Christian G. Bower, Sep 07 2002

Keywords

Comments

From Richard L. Ollerton, May 07 2021: (Start)
Here, as in A000031, turning over is not allowed.
(1/n) * Dirichlet convolution of phi(n) and k^n. (End)

Examples

			The array T(n,k) for n >= 1, k >= 1 begins:
  1,  2,   3,    4,     5,     6,      7, ...
  1,  3,   6,   10,    15,    21,     28, ...
  1,  4,  11,   24,    45,    76,    119, ...
  1,  6,  24,   70,   165,   336,    616, ...
  1,  8,  51,  208,   629,  1560,   3367, ...
  1, 14, 130,  700,  2635,  7826,  19684, ...
  1, 20, 315, 2344, 11165, 39996, 117655, ...
From _Indranil Ghosh_, Mar 25 2017: (Start)
Triangle formed when the array is read by antidiagonals:
   1;
   2,  1;
   3,  3,   1;
   4,  6,   4,   1;
   5, 10,  11,   6,    1;
   6, 15,  24,  24,    8,    1;
   7, 21,  45,  70,   51,   14,    1;
   8, 28,  76, 165,  208,  130,   20,   1;
   9, 36, 119, 336,  629,  700,  315,  36,  1;
  10, 45, 176, 616, 1560, 2635, 2344, 834, 60, 1;
  ... (End)
		

References

  • F. Bergeron, G. Labelle and P. Leroux, Combinatorial Species and Tree-Like Structures, Cambridge, 1998, p. 86 (2.2.23).
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 496.
  • Louis Comtet, Analyse combinatoire, Tome 2, p. 104 #17, P.U.F., 1970.

Crossrefs

Main Diagonal: A056665. A054630 and A054631 are the upper and lower triangles.

Programs

  • Mathematica
    t[n_, k_] := (1/n)*Sum[EulerPhi[d]*k^(n/d), {d, Divisors[n]}]; Table[t[n-k+1, k], {n, 1, 11}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jan 20 2014, after Philippe Deléham *)
  • PARI
    T(n, k) = (1/n) * sumdiv(n, d, eulerphi(d)*k^(n/d));
    for(n=1, 15, for(k=1, n, print1(T(k, n - k + 1),", ");); print();) \\ Indranil Ghosh, Mar 25 2017
    
  • Python
    from sympy.ntheory import totient, divisors
    def T(n,k): return sum(totient(d)*k**(n//d) for d in divisors(n))//n
    for n in range(1, 16):
        print([T(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, Mar 25 2017

Formula

T(n,k) = (1/n)*Sum_{d | n} phi(d)*k^(n/d), where phi = Euler totient function A000010. - Philippe Deléham, Oct 08 2003
From Petros Hadjicostas, Feb 08 2021: (Start)
O.g.f. for column k >= 1: Sum_{n>=1} T(n,k)*x^n = -Sum_{j >= 1} (phi(j)/j) * log(1 - k*x^j).
Linear recurrence for row n >= 1: T(n,k) = Sum_{j=0..n} -binomial(j-n-1,j+1) * T(n,k-1-j) for k >= n + 2. (This recurrence is essentially due to Robert A. Russell, who contributed it in A321791.) (End)
From Richard L. Ollerton, May 07 2021: (Start)
T(n,k) = (1/n)*Sum_{i=1..n} k^gcd(n,i).
T(n,k) = (1/n)*Sum_{i=1..n} k^(n/gcd(n,i))*phi(gcd(n,i))/phi(n/gcd(n,i)).
T(n,k) = (1/n)*A185651(n,k) for n >= 1, k >= 1. (End)
Product_{n>=1} 1/(1 - x^n)^T(n,k) = Product_{n>=1} 1/(1 - k*x^n). - Seiichi Manyama, Apr 12 2025

Extensions

Additional references from Philippe Deléham, Oct 08 2003

A145986 n-th prime in the first occurrence of at least n consecutive primes of the form 4k + 1.

Original entry on oeis.org

5, 17, 101, 409, 2633, 11657, 11677, 11681, 11689, 373777, 766373, 3358373, 12205121, 12270281, 12270301, 12270317, 297388097, 297779509, 297779513, 1113443473, 1113443521, 1113443533, 1113443549, 1113443561, 84676453373, 84676453429
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Comments

a(1)=5 is same as A055623(1) because 5 is a single-digit number.

Examples

			a(2)=17 because this is the 2nd prime in the first run of 2 primes where p == 1 mod 4.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007, pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Mathematica
    Flatten[Table[SequencePosition[Table[If[Mod[p-1,4]==0,1,0],{p,Prime[Range[250000]]}],PadRight[ {},n,1],1],{n,12}],1][[;;,-1]]//Prime (* The program generates the first 12 terms of the sequence. *) (* Harvey P. Dale, Jul 14 2024 *)
  • PARI
    r=0;c=0;forprime(p=2,4e9,if(p%4==1,if(c++>r,r=c;print1(p", ")),c=0)) \\ Charles R Greathouse IV, Mar 22 2011
  • UBASIC
    10 'cluster primes
    20 C=1:input "end #";L
    40 for N=3 to L step 2
    50 S=int(sqrt(N))
    60 for A=3 to S step 2
    70 B=N/A
    80 if int(B)*A=N then cancel for:goto 170
    90 next A
    100 C=C+1: E=int(N/4):R=N-(4*E)
    120 if R=1 then print N;:C1=C1+1:T1=T1+1:print T1
    130 if R=3 then T1=0:print " ";N;:C3=C3+1:T2=T2+1:print T2
    150 if R=1 then T2=0
    160 if T1>10 or T2>10 then stop
    170 next
    180 print "Total primes=";C;:print "Type A:";C1;" Type B:";C3
    

Extensions

Entry rewritten and a(13)-a(26) added by Charles R Greathouse IV, Mar 22 2011
Edited by M. F. Hasler, May 02 2015
Definition clarified by N. J. A. Sloane, Dec 18 2022

A145988 Ending prime: n-th prime in the first occurrence of n consecutive primes of the form 4k + 3.

Original entry on oeis.org

3, 11, 223, 227, 491, 499, 503, 36607, 39703, 183283, 241727, 241739, 241771, 9177607, 9177611, 95949631, 105639463, 341118731, 727335359, 727335379, 1786054619, 1786054631, 22964264759, 54870713999, 79263248759
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Comments

a(1)=3 is the same as A055624(1) because 3 is a single-digit number.

Examples

			a(2)=11 because this is the 2nd prime in the first run of 2 primes where p == 3 mod 4.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007, pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Mathematica
    Prime[#]&/@Flatten[Table[SequencePosition[If[Mod[#,4]==3,1,0]&/@Prime[ Range[ 615000]],PadRight[{},n,1],1],{n,15}],1][[All,2]] (* The program generates the first 15 terms of the sequence. *) (* Harvey P. Dale, Jun 17 2022 *)
  • PARI
    r=0; c=0; forprime(p=2, 4e9, if(p%4==3, if(c++>r, r=c; print1(p", ")), c=0)) \\ Charles R Greathouse IV, Mar 22 2011
  • UBASIC
    10 'cluster primes 20 C=1 30 input "end #";L 40 for N=3 to L step 2 50 S=int(sqrt(N)) 60 for A=3 to S step 2 70 B=N/A 80 if int(B)*A=N then cancel for:goto 170 90 next A 100 C=C+1 110 E=N/4:E=int(E):R=N-(4*E) 120 if R=1 then print N;:C1=C1+1:T1=T1+1:print T1 130 if R=3 then T1=0 140 if R=3 then print " ";N;:C3=C3+1:T2=T2+1:print T2 150 if R=1 then T2=0 160 if T1>10 or T2>10 then stop 170 next 180 print "Total primes=";C;:print "Type A";C1;"Type B";C3
    

Extensions

Entry rewritten by, and a(14)-a(25) from, Charles R Greathouse IV, Mar 22 2011

A145990 Primes which start a run of at least length 2 of consecutive primes == 1 (mod 4).

Original entry on oeis.org

13, 37, 89, 109, 193, 229, 277, 313, 349, 389, 449, 509, 613, 661, 701, 757, 797, 853, 877, 929, 997, 1093, 1109, 1193, 1237, 1297, 1373, 1429, 1489, 1549, 1597, 1609, 1637, 1669, 1709, 1733, 1789, 1873, 1889, 1933, 1993, 2069, 2113, 2137, 2153, 2213, 2269
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Examples

			a(1)=13 because this sequence includes consecutive runs of any length and this first term > 1 in a run of 2 is 13.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007, pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Maple
    for i from 2 to 300 do
            if (ithprime(i) mod 4) = 1  and ithprime(i-1) mod 4 <> 1 and ithprime(i+1) mod 4 = 1 then
                    printf("%d,",ithprime(i)) ;
            end if;
    end do: # R. J. Mathar, Sep 30 2011
  • Mathematica
    Prime[#+1]&/@(SequencePosition[Table[If[Mod[n,4]==1,1,0],{n,Prime[ Range[ 350]]}],{0,1,1},Overlaps->False][[All,1]]) (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 02 2017 *)
  • UBASIC
    10 'cluster primes
    20 C=1
    30 input "end #";L
    40 for N=3 to L step 2
    50 S=int(sqrt(N))
    60 for A=3 to S step 2
    70 B=N/A
    80 if int(B)*A=N then cancel for:goto 170
    90 next A
    100 C=C+1
    110 E=N/4:E=int(E):R=N-(4*E)
    120 if R=1 then print N;:C1=C1+1:T1=T1+1:print T1
    130 if R=3 then T1=0
    140 if R=3 then print " ";N;:C3=C3+1:T2=T2+1:print T2
    150 if R=1 then T2=0
    160 if T1>10 or T2>10 then stop
    170 next
    180 print "Total primes=";C;:print "Type A";C1;"Type B";C3

Extensions

Corrected and extended by Harvey P. Dale, Aug 02 2017

A285522 Array read by antidiagonals: T(m,n) = number of circulant digraphs up to Cayley isomorphism on n vertices with edges colored according to step value using a maximum of m-1 colors.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 6, 6, 4, 1, 1, 6, 18, 10, 5, 1, 1, 20, 24, 40, 15, 6, 1, 1, 14, 135, 70, 75, 21, 7, 1, 1, 48, 130, 544, 165, 126, 28, 8, 1, 1, 52, 648, 700, 1625, 336, 196, 36, 9, 1, 1, 140, 1137, 4480, 2635, 3996, 616, 288, 45, 10, 1
Offset: 1

Views

Author

Andrew Howroyd, Apr 20 2017

Keywords

Comments

For the base case of m=2 the sequence counts circulant digraphs up to Cayley isomorphism. Two circulant graphs are Cayley isomorphic if there is a d, which is necessarily prime to n, that transforms through multiplication modulo n the step values of one graph into those of the other. For squarefree n this is the only way that two circulant graphs can be isomorphic. (See Liskovets reference for a proof.)
Alternatively, the number of mappings with domain {1..n-1} and codomain {1..m} up to equivalence. Mappings A and B are equivalent if there is a d, prime to n, such that A(i) = B(i*d mod n) for i in {1..n-1}. This sequence differs from A132191 only in that sequence also includes 0 in the domain which introduces an extra factor of m into the results since zero multiplied by anything is zero.
All column sequences are polynomials of order n-1 and these are the cycle index polynomials.
This sequence is also related to A075195(n, m) which counts necklaces and A285548(m, n) which is the sequence described in the Titsworth reference. In particular, A075195 is the analogous array with equivalence determined through the additive group instead of by multiplication whereas A285548 allows for both addition and multiplication.

Examples

			Table starts:
\n  1 2  3   4    5    6    7     8      9      10
m\ ---------------------------------------------------
1 | 1 1  1   1    1    1    1     1      1       1 ...
2 | 1 2  3   6    6   20   14    48     52     140 ...
3 | 1 3  6  18   24  135  130   648   1137    4995 ...
4 | 1 4 10  40   70  544  700  4480  11056   65824 ...
5 | 1 5 15  75  165 1625 2635 20625  65425  489125 ...
6 | 1 6 21 126  336 3996 7826 72576 280596 2521476 ...
...
Case n=10:
Only 1, 3, 7, 9 are prime to 10.
Multiplication modulo 10 is described by the following multiplication table.
  1, 2, 3, 4, 5, 6, 7, 8, 9  => (1)(2)(3)(4)(5)(6)(7)(8)(9) => m^9
  3, 6, 9, 2, 5, 8, 1, 4, 7  => (1397)(2684)(5)             => m^3
  7, 4, 1, 8, 5, 2, 9, 6, 3  => (1793)(2486)(5)             => m^3
  9, 8, 7, 6, 5, 4, 3, 2, 1  => (19)(28)(37)(46)(5)         => m^5
Each row of the multiplication table can be viewed as a permutation and together these form a commutative group on 4 elements. In this case the group is isomorphic to the cyclic group C_4. Each permutation can be represented in cycle notation. (shown above to the right of the corresponding multiplication table row). In order to count the equivalence classes using Polya's enumeration theorem only the number of cycles in each permutation is needed.
This gives the cycle index polynomial (1/4)*(m^9 + m^5 + 2*m^3). Putting m = 1..4 gives 1, 140, 4995, 65824.
		

Crossrefs

Programs

  • Mathematica
    A132191[m_, n_] := (1/EulerPhi[n])*Sum[If[GCD[k, n] == 1, m^DivisorSum[n, EulerPhi[#] / MultiplicativeOrder[k, #] &], 0], {k, 1, n}];
    T[m_, n_] := A132191[m, n]/m;
    Table[T[m - n + 1, n], {m, 1, 11}, {n, m, 1, -1}] // Flatten (* Jean-François Alcover, Jun 06 2017 *)
  • PARI
    a(n,x)=sum(k=1, n, if(gcd(k, n)==1, x^(sumdiv(n, d, eulerphi(d)/znorder(Mod(k, d)))-1), 0))/eulerphi(n);
    for(m=1, 6, for(n=1, 10, print1( a(n,m), ", ") ); print(); );

Formula

T(m, n) = A132191(m, n) / m.

A145989 Run lengths of consecutive primes == 1 (mod 4) where the run length is at least 2.

Original entry on oeis.org

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

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Comments

The run lengths of 1's in A039702 are 1, 2, 1, 2, 1, 1, 1, 3,.. as listed in A091318. Deleting all 1's from A091318 generates this sequence here. - R. J. mathar, Sep 30 2011
The maximum run length in the first 1000 terms is 9. - Harvey P. Dale, Jul 27 2025

Examples

			a(1)=2 because this sequence includes consecutive runs of any length and this first occurrence > 1 is a run of 2.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007. Pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Mathematica
    Length/@Select[Split[Table[If[Mod[p,4]==1,1,0],{p,Prime[Range[500]]}]],#[[1]]==1&&Length[#]>1&] (* Harvey P. Dale, Jul 27 2025 *)
  • UBASIC
    10 'cluster primes
    20 C=1
    30 input "end #";L
    40 for N=3 to L step 2
    50 S=int(sqrt(N))
    60 for A=3 to S step 2
    70 B=N/A
    80 if int(B)*A=N then cancel for:goto 170
    90 next A
    100 C=C+1
    110 E=N/4:E=int(E):R=N-(4*E)
    120 if R=1 then print N;:C1=C1+1:T1=T1+1:print T1
    130 if R=3 then T1=0
    140 if R=3 then print " ";N;:C3=C3+1:T2=T2+1:print T2
    150 if R=1 then T2=0
    160 if T1>10 or T2>10 then stop
    170 next
    180 print "Total primes=";C;:print "Type A";C1;"Type B";C3

A145991 Final prime in a run of more than 1 consecutive primes == 1 (mod 4).

Original entry on oeis.org

17, 41, 101, 113, 197, 233, 281, 317, 353, 409, 461, 521, 617, 677, 709, 773, 809, 857, 881, 941, 1013, 1097, 1117, 1217, 1249, 1301, 1381, 1433, 1493, 1553, 1601, 1613, 1657, 1697, 1721, 1741, 1801, 1877, 1901, 1949, 1997, 2081, 2129, 2141, 2161, 2237
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Examples

			a(1)=17 because this sequence includes consecutive runs of any length and this ending term > 1 in a run of 2 (comprising 13 and 17) is 17.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007. Pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • UBASIC
    10 'cluster primes
    20 C=1
    30 input "end #";L
    40 for N=3 to L step 2
    50 S=int(sqrt(N))
    60 for A=3 to S step 2
    70 B=N/A
    80 if int(B)*A=N then cancel for:goto 170
    90 next A
    100 C=C+1
    110 E=N/4:E=int(E):R=N-(4*E)
    120 if R=1 then print N;:C1=C1+1:T1=T1+1:print T1
    130 if R=3 then T1=0
    140 if R=3 then print " ";N;:C3=C3+1:T2=T2+1:print T2
    150 if R=1 then T2=0
    160 if T1>10 or T2>10 then stop
    170 next
    180 print "Total primes=";C;:print "Type A";C1;"Type B";C3
Showing 1-7 of 7 results.