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

A175851 a(n) = 1 for noncomposite n, a(n) = n - previousprime(n) + 1 for composite n.

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Sep 29 2010

Keywords

Comments

Sequence is cardinal and not fractal. Cardinal sequence is sequence with infinitely many times occurring all natural numbers. Fractal sequence is sequence such that when the first instance of each number in the sequence is erased, the original sequence remains.
Ordinal transform of the nextprime function, A151800(1..) = 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, ..., also ordinal transform of A304106. - Antti Karttunen, Jun 09 2018

Crossrefs

Cf. A065358 for another way of visualizing prime gaps.
Cf. A304106 (ordinal transform of this sequence).
Cf. A049711.

Programs

Formula

a(1) = 1, a(n) = n - A007917(n) + 1 for n >= 2. a(1) = 1, a(2) = 1, a(n) = n - A151799(n+1) + 1 for n >= 3.
a(n) = Sum_{i=1..n} floor(pi(i)/pi(n)), for n>1 with pi(n) = A000720(n). - Ridouane Oudra, Jun 24 2024
a(n) = A049711(n+1), for n>1. - Ridouane Oudra, Jul 16 2024

A305437 Running index for the lexicographically least irreducible factor when (0,1)-polynomial obtained from the binary expansion of n is factored over Q.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 09 2018

Keywords

Examples

			Numbers 1 .. 6 encode the following (0,1)-polynomials by their binary representation:
  1 -> 1       [Empty factorization]
  2 -> x       [Irreducible, the only and thus also the least factor is x]
  3 -> x + 1   [Irreducible, the least factor is (x+1)]
  4 -> x^2      = (x)(x)   [The least factor (x) occurred already for the first time at n=2, thus a(4) = 2.]
  5 -> x^2 + 1 [Irreducible, the least factor is (x^2 + 1)]
  6 -> x^2 + x  = (x)(x+1) [The least factor (x) occurred already at n=2, thus a(6) = 2.]
Binary representation of 7 is "111", encoding (0,1)-polynomial x^2 + x + 1, which is irreducible over Q, so it is the first time that polynomial occurs as a "smallest" (lexicographically least) irreducible factor, while before it, already four different kinds of "smallest" factors have occurred, thus a(7) = 5.
The second time the same factor occurs as the smallest one is for n=35, whose binary representation "100011" encodes polynomial x^5 + x + 1 = (x^2 + x + 1)(x^3 - x^2 + 1) , thus a(35) = 5 also.
The third time the same factor occurs as the smallest one is for n=49, whose binary representation "110001" encodes polynomial x^5 + x^4 + 1 = (x^2 + x + 1)(x^3 - x + 1), thus a(49) = 5 also.
		

Crossrefs

Cf. A305438 (ordinal transform).
Cf. also A055396, A302786.

Programs

  • PARI
    allocatemem(2^30);
    default(parisizemax,2^31);
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    pollexcmp(a,b) = { my(ad = poldegree(a), bd = poldegree(b),e); if(ad != bd, return(sign(ad-bd))); for(i=0,ad,e = polcoeff(a,ad-i) - polcoeff(b,ad-i); if(0!=e, return(sign(e)))); (0); };
    lexleastpolfactor(n) = if(1==n,0,my(fs = factor(Pol(binary(n)))[,1]~); vecsort(fs,pollexcmp)[1]);
    v305437 = rgs_transform(vector(up_to,n,lexleastpolfactor(n)));
    A305437(n) = v305437[n];
Showing 1-2 of 2 results.