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

A254218 T(n,k) = number of length n 1..(k+2) arrays with no leading or trailing partial sum equal to a prime and no consecutive values equal.

Original entry on oeis.org

1, 2, 0, 2, 0, 0, 3, 0, 1, 0, 3, 2, 3, 2, 1, 4, 2, 11, 4, 2, 0, 5, 8, 12, 22, 8, 2, 0, 6, 12, 32, 24, 56, 6, 2, 0, 6, 18, 48, 96, 70, 136, 15, 2, 0, 7, 18, 86, 168, 373, 192, 383, 18, 5, 0, 7, 28, 98, 388, 766, 1472, 633, 1070, 45, 4, 0, 8, 28, 172, 490, 2056, 3720, 6490, 2484, 3897
Offset: 1

Views

Author

R. H. Hardin, Jan 26 2015

Keywords

Comments

Table starts
.1.2...2.....3.....3......4.......5........6........6.........7.........7
.0.0...0.....2.....2......8......12.......18.......18........28........28
.0.1...3....11....12.....32......48.......86.......98.......172.......183
.0.2...4....22....24.....96.....168......388......490......1024......1168
.1.2...8....56....70....373.....766.....2056.....2803......6705......8187
.0.2...6...136...192...1472....3720....11182....16698.....44652.....58174
.0.2..15...383...633...6490...18214....60168....97089....296955....420163
.0.2..18..1070..2484..28190...81428...316982...574274...2056696...3150280
.0.5..45..3897.10554.109811..362910..1788533..3605385..14593061..23955140
.0.4.118.13372.35054.428042.1828848.10469104.22736838.103347086.183929058

Examples

			Some solutions for n=4 k=4
..4....4....4....1....1....1....1....6....6....6....1....6....4....4....4....6
..6....2....2....3....5....5....5....3....3....4....5....2....2....5....6....4
..4....4....3....2....6....3....4....5....5....2....3....4....6....3....2....2
..6....6....1....4....4....6....6....1....4....4....1....6....4....6....4....6
		

Crossrefs

Row 1 is A062298(n+2).
Column k=1 gives A254211.

A254539 T(n,k)=Number of length n 1..(k+2) arrays with no leading partial sum equal to a prime.

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 3, 5, 8, 2, 3, 10, 15, 20, 4, 4, 11, 40, 45, 50, 6, 5, 20, 49, 160, 135, 126, 11, 6, 28, 105, 222, 670, 421, 329, 20, 6, 37, 163, 576, 1087, 3001, 1466, 956, 33, 7, 41, 253, 1026, 3383, 5604, 13503, 5403, 2897, 62, 7, 54, 307, 1849, 6814, 20393, 29038, 60408
Offset: 1

Views

Author

R. H. Hardin, Feb 01 2015

Keywords

Comments

Table starts
..1....2.....2.......3.......3........4........5.........6.........6..........7
..1....3.....5......10......11.......20.......28........37........41.........54
..1....8....15......40......49......105......163.......253.......307........466
..2...20....45.....160.....222......576.....1026......1849......2461.......4195
..4...50...135.....670....1087.....3383.....6814.....13843.....20012......37643
..6..126...421....3001....5604....20393....45472....102595....161277.....338402
.11..329..1466...13503...29038...121774...297210....758766...1313695....3093457
.20..956..5403...60408..150268...709169..1936867...5719495..10916298...28507728
.33.2897.19417..270370..764508..4121638.12941917..43758333..91142820..262001403
.62.8341.69205.1192385.3857845.24622476.88456127.333905794.755234611.2410105286

Examples

			Some solutions for n=4 k=4
..4....4....6....6....6....4....4....6....1....4....6....1....4....1....6....6
..4....6....6....3....2....6....2....6....5....5....6....5....6....3....3....2
..1....5....4....5....1....2....2....2....2....1....2....6....6....5....1....4
..1....5....4....2....6....2....1....1....1....2....2....6....4....3....5....4
		

Crossrefs

Row 1 is A062298(n+2)

A255716 T(n,k)=Number of length n 1..(k+2) arrays with no leading partial sum equal to a prime and no consecutive values equal.

Original entry on oeis.org

1, 2, 1, 2, 2, 1, 3, 4, 4, 1, 3, 8, 10, 6, 1, 4, 9, 26, 21, 8, 1, 5, 17, 33, 81, 47, 14, 1, 6, 24, 75, 120, 261, 102, 19, 1, 6, 32, 121, 342, 480, 936, 256, 33, 1, 7, 36, 191, 653, 1707, 2079, 3435, 754, 69, 1, 7, 48, 242, 1221, 3764, 8814, 9044, 12406, 2169, 162, 1, 8, 52, 374
Offset: 1

Views

Author

R. H. Hardin, Mar 03 2015

Keywords

Comments

Table starts
.1...2....2......3......3.......4........5.........6.........6.........7
.1...2....4......8......9......17.......24........32........36........48
.1...4...10.....26.....33......75......121.......191.......242.......374
.1...6...21.....81....120.....342......653......1221......1729......3037
.1...8...47....261....480....1707.....3764......8072.....12646.....24669
.1..14..102....936...2079....8814....22155.....53090.....91493....200228
.1..19..256...3435...9044...45735...127375....346499....667623...1659159
.1..33..754..12406..39604..229317...721134...2312940...4999570..13912571
.1..69.2169..45637.170835.1129024..4201419..15787318..37773069.116235183
.1.162.5999.165303.720348.5744720.25338485.107642427.282611786.969235198

Examples

			Some solutions for n=4 k=4
..4....4....4....6....4....1....1....6....1....1....1....1....6....1....4....1
..5....5....6....2....6....3....5....3....3....3....3....5....3....3....6....3
..3....6....4....6....4....4....2....1....2....5....6....6....1....2....2....6
..6....3....2....4....6....1....4....2....6....1....5....4....5....3....6....2
		

Crossrefs

Row 1 is A062298(n+2)

A239968 a(n) = 0 unless n is a nonprime A018252(k) then a(n) = k.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 30 2014

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr, genericIndex)
    a239968 n = genericIndex a239968_list (n - 1)
    a239968_list = unfoldr c (1, 1, a018252_list) where
       c (i, z, xs'@(x:xs)) | i == x = Just (z, (i + 1, z + 1, xs))
                            | i /= x = Just (0, (i + 1, z, xs'))
  • Mathematica
    Module[{k = 0}, Array[If[!PrimeQ[#], ++k, 0] &, 100]] (* Paolo Xausa, Jul 31 2025 *)

Formula

a(n) = A066246(n) - A010051(n) + 1.
a(n) = A026233(n) - A049084(n);
A057427(a(n)) = A005171(n).
a(n) = A062298(n)*A005171(n). - Ridouane Oudra, Jul 29 2025

A356068 Number of integers ranging from 1 to n that are not prime-powers (1 is not a prime-power).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 7, 8, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 22, 23, 24, 25, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 42
Offset: 1

Views

Author

Gus Wiseman, Jul 31 2022

Keywords

Examples

			The a(30) = 14 numbers: 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, 26, 28, 30.
		

Crossrefs

The complement is counted by A025528, with 1's A065515.
For primes instead of prime-powers we have A062298, with 1's A065855.
The version treating 1 as a prime-power is A085970.
One more than the partial sums of A143731.
A000688 counts factorizations into prime-powers.
A001222 counts prime-power divisors.
A246655 lists the prime-powers (A000961 includes 1), towers A164336.

Programs

  • Mathematica
    Table[Length[Select[Range[n],!PrimePowerQ[#]&]],{n,100}]

Formula

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

A065134 Remainder when n is divided by the number of primes not exceeding n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Oct 15 2001

Keywords

Comments

Also remainder when the number of nonprimes is divided by the number of primes (not exceeding n).

Examples

			n = 2: Pi[2] = 1,Mod[1,1] = 0, the first term = a(2) = 0; n = 100: Pi[100] = 25, Mod[100,25] = 0 = a(100); n = 20: Pi[20] = 8, Mod[20,8] = 4 = a(20).
		

Crossrefs

Programs

  • Mathematica
    Table[Last@ QuotientRemainder[n, PrimePi[n]], {n, 2, 91}] (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    { for (n=2, 1000, write("b065134.txt", n, " ", n%primepi(n)) ) } \\ Harry J. Smith, Oct 11 2009

Formula

a(n) = n (mod pi(n)).

Extensions

Term a(1) removed so OFFSET changed from 1,5 to 2,4 by Harry J. Smith, Oct 11 2009
Since OFFSET is 2,4; Term a(1) removed and a(91) added by Harry J. Smith, Oct 11 2009

A245821 Permutation of natural numbers: a(n) = A091205(A245703(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 6, 8, 12, 11, 15, 23, 81, 18, 10, 17, 30, 13, 162, 27, 36, 19, 24, 16, 25, 38, 46, 37, 45, 31, 135, 14, 20, 50, 57, 47, 69, 21, 55, 83, 115, 419, 87, 60, 210, 61, 42, 54, 26, 90, 28, 29, 35, 32, 63, 171, 52, 59, 138, 113, 180, 111, 48, 88, 39, 41, 621, 72, 22, 953, 230, 103, 207, 126, 64, 33, 243
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Crossrefs

Inverse: A245822.
Other related permutations: A091205, A245703, A245815.
Fixed points: A245823.

Programs

  • PARI
    allocatemem(234567890);
    v014580 = vector(2^18);
    v091226 = vector(2^22);
    v091242 = vector(2^22);
    isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from Charles R Greathouse IV
    i=0; j=0; n=2; while((n < 2^22), if(isA014580(n), i++; v014580[i] = n; v091226[n] = v091226[n-1]+1, j++; v091242[j] = n; v091226[n] = v091226[n-1]); n++);
    A014580(n) = v014580[n];
    A091226(n) = v091226[n];
    A091242(n) = v091242[n];
    A091205(n) = if(n<=1, n, if(isA014580(n), prime(A091205(A091226(n))), {my(irfs, t); irfs=subst(lift(factor(Mod(1, 2)*Pol(binary(n)))), x, 2); irfs[,1]=apply(t->A091205(t), irfs[,1]); factorback(irfs)}));
    A245703(n) = if(1==n, 1, if(isprime(n), A014580(A245703(primepi(n))), A091242(A245703(n-primepi(n)-1))));
    A245821(n) = A091205(A245703(n));
    for(n=1, 10001, write("b245821.txt", n, " ", A245821(n)));
    
  • Scheme
    (define (A245821 n) (A091205 (A245703 n)))

Formula

a(n) = A091205(A245703(n)).
Other identities. For all n >= 1, the following holds:
A078442(a(n)) = A078442(n), A049076(a(n)) = A049076(n). [Preserves "the order of primeness of n"].
a(p_n) = p_{a(n)} where p_n is the n-th prime, A000040(n).
a(n) = A049084(a(A000040(n))). [Thus the same permutation is induced also when it is restricted to primes].
A245815(n) = A062298(a(A018252(n))). [While restriction to nonprimes induces another permutation].

A179278 Largest nonprime integer <= n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 08 2010

Keywords

Examples

			From _Gus Wiseman_, Dec 04 2024: (Start)
The nonprime integers <= n:
  1  1  1  4  4  6  6  8  9  10  10  12  12  14  15  16
           1  1  4  4  6  8  9   9   10  10  12  14  15
                 1  1  4  6  8   8   9   9   10  12  14
                       1  4  6   6   8   8   9   10  12
                          1  4   4   6   6   8   9   10
                             1   1   4   4   6   8   9
                                     1   1   4   6   8
                                             1   4   6
                                                 1   4
                                                     1
(End)
		

Crossrefs

For prime we have A007917.
For nonprime we have A179278 (this).
For squarefree we have A070321.
For nonsquarefree we have A378033.
For prime power we have A031218.
For non prime power we have A378367.
For perfect power we have A081676.
For non perfect power we have A378363.
A000040 lists the primes, differences A001223.
A002808 lists the composite numbers, differences A073783.
A018252 lists the nonprimes, differences A065310.
A095195 has row n equal to the k-th differences of the prime numbers.
A113646 gives least nonprime >= n.
A151800 gives the least prime > n, weak version A007918.
A377033 has row n equal to the k-th differences of the composite numbers.

Programs

  • Mathematica
    Array[# - Boole[PrimeQ@ #] - Boole[# == 3] &, 72] (* Michael De Vlieger, Oct 13 2018 *)
    Table[Max@@Select[Range[n],!PrimeQ[#]&],{n,30}] (* Gus Wiseman, Dec 04 2024 *)
  • PARI
    a(n) = if (isprime(n), if (n==3, 1, n-1), n); \\ Michel Marcus, Oct 13 2018

Formula

For n > 3: a(n) = A113523(n) = A014684(n);
For n > 0: a(n) = A113638(n). - Georg Fischer, Oct 12 2018
A005171(a(n)) = 1; A010051(a(n)) = 0.
a(n) = A018252(A062298(n)). - Ridouane Oudra, Aug 22 2025

Extensions

Inequality in the name reversed by Gus Wiseman, Dec 05 2024

A245822 Permutation of natural numbers: a(n) = A245704(A091204(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 9, 6, 16, 11, 10, 19, 33, 12, 25, 17, 15, 23, 34, 39, 70, 13, 24, 26, 50, 21, 52, 53, 18, 31, 55, 77, 93, 54, 22, 29, 27, 66, 105, 67, 48, 137, 156, 30, 28, 37, 64, 91, 35, 85, 58, 97, 49, 40, 98, 36, 135, 59, 45, 47, 261, 56, 76, 92, 122, 83, 374, 38, 102, 139, 69, 167, 130, 88, 203, 351, 212, 349, 235, 14
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Crossrefs

Inverse: A245821.
Other related permutations: A091204, A245704, A245816.
Fixed points: A245823.

Programs

Formula

a(n) = A245704(A091204(n)).
Other identities. For all n >= 1, the following holds:
A078442(a(n)) = A078442(n), A049076(a(n)) = A049076(n). [Preserves "the order of primeness of n"].
a(p_n) = p_{a(n)} where p_n is the n-th prime, A000040(n).
a(n) = A049084(a(A000040(n))). [Thus the same permutation is induced also when it is restricted to primes].
A245816(n) = A062298(a(A018252(n))). [While restriction to nonprimes induces another permutation].

A065864 Remainder when n is divided by the number of nonprimes not exceeding n.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 21
Offset: 1

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Examples

			For n=100, pi(100)=25, so a(100) = 100 mod (100-25) = 25.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[n, n - PrimePi@ n], {n, 78}] (* or *)
    Table[Mod[n, Count[Range@ n, k_ /; ! PrimeQ@ k]], {n, 78}] (* Michael De Vlieger, Jan 01 2017 *)
  • PARI
    { for (n = 1, 1000, a=n%(n - primepi(n)); write("b065864.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 02 2009

Formula

a(n) = n mod (n-pi(n)) = n mod (n-A000720(n)) = n mod A062298(n).
Previous Showing 11-20 of 53 results. Next