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

A292258 a(1) = 1; for n > 1, a(n) = prime(A101296(n)-1) * a(floor(n/2)).

Original entry on oeis.org

1, 2, 2, 6, 4, 10, 4, 42, 18, 20, 8, 110, 20, 20, 20, 546, 84, 198, 36, 220, 100, 40, 16, 1870, 330, 100, 140, 220, 40, 380, 40, 12558, 2730, 420, 420, 5742, 396, 180, 180, 3740, 440, 1900, 200, 440, 440, 80, 32, 57970, 5610, 3630, 1650, 1100, 200, 2380, 700, 3740, 1100, 200, 80, 14060, 760, 200, 440, 514878
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2017

Keywords

Crossrefs

Cf. A000040, A000523, A004526, A007814, A078349, A101296, A292259 (rgs-version of this filter).

Programs

  • Mathematica
    With[{nn = 64}, Block[{s = Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Table[Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]] - Boole[n == 1], {n, nn}], a}, a[n_] := a[n] = If[n == 1, 1, Prime[s[[n]] - 1]*a[Floor[n/2]]]; Array[a, nn]]] (* Michael De Vlieger, Sep 22 2017 *)
  • PARI
    up_to = 8191
    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; };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    v101296 = rgs_transform(vector(up_to, n, A046523(n)));
    A101296(n) = v101296[n];
    A292258(n) = if(1==n,n,prime(A101296(n)-1) * A292258(n\2));

Formula

a(1) = 1; for n > 1, a(n) = A000040(A101296(n)-1) * a(A004526(n)).
Other identities. For all n >= 1:
A001222(a(n)) = A000523(n).
A007814(a(n)) = A078349(n).

A292936 a(n) = the least k >= 0 such that floor(n/(2^k)) is a nonprime; a(n) is degree of the "safeness" of prime, 0 if n is not a prime, 1 for unsafe primes (A059456), and k >= 2 for primes that are (k-1)-safe but not k-safe.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 27 2017

Keywords

Comments

Records occur at positions 1, 2, 5, 11, 23, 47, 2879, ... (A292937).

Crossrefs

Cf. A000040, A005385, A066179, A157358, A157359 (positions of terms that are > k, for k = 0..4).
Cf. A059456 (positions of ones).

Programs

  • Maple
    A292936 := proc(n)
        for k from 0 do
            if not isprime(floor(n/2^k)) then
                return k;
            end if;
        end do:
    end proc:
    seq(A292936(n),n=1..100) ; # R. J. Mathar, Sep 28 2017
  • Mathematica
    Table[SelectFirst[Range[0, 10], ! PrimeQ@ Floor[n/(2^#)] &], {n, 105}] (* Michael De Vlieger, Sep 29 2017 *)
  • PARI
    A292936(n) = { my(k=0); while(isprime(n), n >>= 1; k++); k; };
    
  • Scheme
    (define (A292936 n) (A007814 (1+ (A292599 n))))

Formula

a(n) = A007814(1+A292599(n)).
For n >= 1, a(n) <= A078349(n).
For n > 47, a(n) <= A007814(1+n).

A292259 Restricted growth sequence transform of A292258; filter constructed from the prime signatures of the sequence [n, floor(n/2), floor(n/4), ..., 1].

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 22 2017

Keywords

Crossrefs

Cf. A292258.
Cf. A078349 (one of the matching sequences).

Programs

  • PARI
    up_to = 65535
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    v101296 = rgs_transform(vector(up_to, n, A046523(n)));
    A101296(n) = v101296[n];
    A292258(n) = if(1==n,n,prime(A101296(n)-1) * A292258(n\2));
    write_to_bfile(1,rgs_transform(vector(up_to,n,A292258(n))),"b292259.txt");

A292598 a(n) is the number of odd primes in the sequence [n, floor(n/2), floor(n/4), ..., 1].

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 27 2017

Keywords

Crossrefs

Formula

a(1) = a(2) = 0; for n > 2, a(n) = A010051(n) + a(floor(n/2)).
a(n) = A000120(A292596(n)).
For all n >= 1, a(n) <= A078349(n).

A292599 a(1) = 0; for n > 1, a(n) = A010051(n) + 2*a(floor(n/2)).

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 3, 4, 4, 6, 7, 4, 5, 6, 6, 8, 9, 8, 9, 12, 12, 14, 15, 8, 8, 10, 10, 12, 13, 12, 13, 16, 16, 18, 18, 16, 17, 18, 18, 24, 25, 24, 25, 28, 28, 30, 31, 16, 16, 16, 16, 20, 21, 20, 20, 24, 24, 26, 27, 24, 25, 26, 26, 32, 32, 32, 33, 36, 36, 36, 37, 32, 33, 34, 34, 36, 36, 36, 37, 48, 48, 50, 51, 48, 48, 50, 50, 56, 57, 56, 56, 60, 60, 62, 62, 32
Offset: 1

Views

Author

Antti Karttunen, Sep 27 2017

Keywords

Comments

1-bits in base-2 expansion of a(n) indicate the positions of primes in the sequence [n, floor(n/2), floor(n/4), ..., 1].

Crossrefs

Cf. also A292596 (variant for odd primes).

Programs

  • Maple
    A292599 := proc(n)
        option remember;
        if n = 1 then
            0 ;
        else
            A010051(n) + 2*procname(floor(n/2)) ;
        end if;
    end proc:
    seq(A292599(n),n=1..100) ; # R. J. Mathar, Sep 28 2017
  • Mathematica
    a[1] = 0; a[n_] := a[n] = Boole[PrimeQ[n]] + 2*a[Floor[n/2]]; Array[a, 96] (* Jean-François Alcover, Sep 29 2017 *)

Formula

a(1) = 0; for n > 1, a(n) = A010051(n) + 2*a(floor(n/2)).
Other identities. For all n >= 1:
A000120(a(n)) = A078349(n).
A007814(1+a(n)) = A292936(n).
Showing 1-5 of 5 results.