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

A245813 Permutation of natural numbers induced when A091205 is restricted to {1} and binary codes for polynomials reducible over GF(2): a(1) = 1, a(n) = A062298(A091205(A091242(n-1))).

Original entry on oeis.org

1, 2, 5, 3, 4, 9, 11, 7, 6, 18, 10, 59, 20, 25, 16, 8, 50, 15, 32, 31, 12, 13, 38, 21, 41, 125, 85, 43, 17, 45, 52, 35, 22, 19, 103, 105, 33, 24, 14, 190, 68, 27, 66, 28, 161, 29, 80, 26, 54, 46, 177, 84, 258, 34, 180, 64, 90, 70, 507, 37, 196, 96, 39, 110, 430, 92, 78, 75, 600, 48, 40, 82, 213, 218, 71, 23, 87, 72, 51, 132, 30
Offset: 1

Views

Author

Antti Karttunen, Aug 16 2014

Keywords

Crossrefs

Inverse: A245814.
Related permutations: A091205, A245815, A245820.

Programs

  • PARI
    allocatemem(234567890);
    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++; v091226[n] = v091226[n-1]+1, j++; v091242[j] = n; v091226[n] = v091226[n-1]); n++);
    A062298(n) = n-primepi(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)}));
    A245813(n) = if(n<=1, n, A062298(A091205(A091242(n-1))));
    for(n=1, 10001, write("b245813.txt", n, " ", A245813(n)));
    
  • Scheme
    (define (A245813 n) (if (<= n 1) n (A062298 (A091205 (A091242 (- n 1))))))

Formula

a(1) = 1, and for n > 1, a(n) = A062298(A091205(A091242(n-1))).
As a composition of related permutations:
a(n) = A245815(A245820(n)).

A245815 Permutation of natural numbers induced when A245821 is restricted to nonprime numbers: a(n) = A062298(A245821(A018252(n))).

Original entry on oeis.org

1, 2, 5, 3, 4, 7, 9, 59, 11, 6, 20, 125, 18, 25, 15, 10, 16, 26, 32, 31, 103, 8, 12, 35, 41, 50, 13, 39, 85, 64, 43, 164, 29, 38, 17, 66, 19, 24, 21, 45, 132, 37, 105, 139, 82, 33, 65, 27, 507, 52, 14, 180, 161, 96, 46, 22, 190, 141, 87, 1603, 80, 36, 143, 107, 54, 670, 34, 47, 23, 68, 177, 1337, 40
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

This permutation is induced when A245821 is restricted to nonprimes, A018252, the first column of A114537, but equally, when it is restricted to column 2 (A007821), column 3 (A049078), etc. of that square array, or alternatively, to the successive rows of A236542.
The sequence of fixed points f(n) begins as 1, 2, 15, 142, 548, 1694, 54681. A018252(f(n)) gives the nonprime terms of A245823.

Crossrefs

Inverse: A245816.
Related permutations: A245813, A245819, A245821.

Programs

Formula

a(n) = A062298(A245821(A018252(n))).
As a composition of related permutations:
a(n) = A245813(A245819(n)).
Also following holds for all n >= 1:

A245816 Permutation of natural numbers induced when A245822 is restricted to nonprime numbers: a(n) = A062298(A245822(A018252(n))).

Original entry on oeis.org

1, 2, 4, 5, 3, 10, 6, 22, 7, 16, 9, 23, 27, 51, 15, 17, 35, 13, 37, 11, 39, 56, 69, 38, 14, 18, 48, 78, 33, 120, 20, 19, 46, 67, 24, 62, 42, 34, 28, 73, 25, 103, 31, 206, 40, 55, 68, 92, 300, 26, 76, 50, 99, 65, 157, 281, 165, 184, 8, 121, 134, 277, 423, 30, 47, 36, 223, 70, 514, 75, 101, 116, 236, 139, 74
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

This permutation is induced when A245822 is restricted to nonprimes, A018252, the first column of A114537, but equally, when it is restricted to column 2 (A007821), column 3 (A049078), etc. of that square array, or alternatively, to the successive rows of A236542.
The sequence of fixed points f(n) begins as 1, 2, 15, 142, 548, 1694, 54681. A018252(f(n)) gives the nonprime terms of A245823.

Crossrefs

Inverse: A245815.
Related permutations: A245814, A245820, A245822.

Programs

Formula

a(n) = A062298(A245822(A018252(n))).
As a composition of related permutations:
a(n) = A245820(A245814(n)).
Also following holds for all n >= 1:
etc.

A338237 a(n) is the number of nodes with depth of n in a binary tree defined as: root = 1 and a child (C) of a node (N) is such that C - primepi(C) = N, or A062298(C) = N. For a node with two children, the smaller child is assigned as the left child and the bigger one as the right child. Otherwise, the child is assigned as the left child.

Original entry on oeis.org

1, 2, 4, 6, 8, 11, 15, 18, 24, 30, 36, 46, 54, 66, 78, 94, 110, 130, 154, 179, 205, 240, 278, 317, 365, 418, 474, 539, 612, 692, 783, 885, 993, 1116, 1254, 1399, 1570, 1752, 1950, 2166, 2408, 2690, 2976, 3287, 3644, 4023, 4449, 4892, 5391, 5946, 6523, 7169
Offset: 0

Views

Author

Ya-Ping Lu, Oct 17 2020

Keywords

Comments

The binary tree, read from left to right in the order of increasing depth n, is the positive integer sequence A000027. The first 65 numbers in the binary tree are shown in the figure below.
1
/ \
2 3
/ \ / \
4 5 6 7
/ / / \ / \
8 9 10 11 12 13
/ / / \ / \ / /
14 15 16 17 18 19 20 21
/ \ / / / / / \ / \ /
22 23 24 25 26 27 28 29 30 31 32
/ / / / \ / / / \ / \ / / / \
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
/ / / / / \ / / / / / \ / \ / / / /
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
Every node has either one child or two children and, thus, the binary tree has no leaves. All left children except 2 are composites and all odd primes are right children.
a(n) for n >= 1 in this sequence is the number of terms in A090532 having the value of n.
The left side of the binary tree is A025003 with a(1) = 1. A025003 is the smallest number that takes n steps to reach 1 when map A062298 is applied to an integer.
Starting from the root, there is only one path in which all nodes have two children. The path is 1 -> 3 -> 6 -> 11 -> 19 -> 29 - > 43 -> 60 -> 83, which contains 9 nodes.

Crossrefs

Programs

  • Mathematica
    c = q = 0; w = {}; Do[Set[a[i], If[PrimeQ[i], c++, a[i - c]]]; q++; If[a[i] == 0, AppendTo[w, q]; q = 0], {i, 2, 10^5}]; Most[w]  (* Michael De Vlieger, Nov 04 2021 *)
  • Python
    from sympy import primepi
    def depth(k):
        d = 0
        while k > 1:
            k -= primepi(k)
            d += 1
        return d
    m = 1
    for n in range (0, 101):
        a = 0
        while depth(m + a) == n:
            a += 1
        print(a)
        m += a

A245820 Permutation of natural numbers induced when A245704 is restricted to {1} and binary codes for polynomials reducible over GF(2): a(1) = 1, a(n) = A062298(A245704(A091242(n-1))).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 6, 10, 13, 16, 8, 11, 14, 17, 22, 26, 15, 19, 20, 23, 27, 34, 39, 25, 12, 29, 31, 35, 40, 50, 24, 56, 37, 21, 43, 46, 38, 51, 57, 70, 48, 36, 78, 53, 33, 61, 18, 65, 55, 71, 79, 95, 67, 52, 30, 106, 75, 49, 42, 85, 54, 28, 89, 77, 96, 107, 74, 126, 92, 73, 45, 141, 98, 101, 69, 59, 116, 76, 41, 120, 105
Offset: 1

Views

Author

Antti Karttunen, Aug 16 2014

Keywords

Crossrefs

Inverse: A245819.
Related permutations: A245704, A245813, A245816.

Programs

Formula

a(1) = 1, and for n > 1, a(n) = 1 + A245704(n-1).
a(1) = 1, and for n > 1, a(n) = A062298(A245704(A091242(n-1))). [Induced when A245704 is restricted to {1} and binary codes for polynomials reducible over GF(2)].
a(1) = 1, and for n > 1, a(n) = A036234(A245704(A014580(n-1))). [Induced also when A245703 is restricted to {1} and other binary codes for polynomials not reducible over GF(2)].
As a composition of related permutations:
a(n) = A245816(A245813(n)).

A338215 a(n) = A095117(A062298(n)).

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 5, 6, 8, 9, 9, 11, 11, 12, 13, 14, 14, 16, 16, 17, 19, 20, 20, 21, 22, 24, 25, 27, 27, 28, 28, 29, 30, 32, 33, 34, 34, 35, 36, 37, 37, 39, 39, 40, 42, 43, 43, 44, 45, 46, 47, 49, 49, 50, 51, 52, 54, 55, 55, 57, 57, 58, 59, 60, 62, 63, 63, 64
Offset: 1

Views

Author

Ya-Ping Lu, Oct 17 2020

Keywords

Comments

It can be shown that there is at least one prime number between n-pi(n) and n for n >= 3, or pi(n-1)-pi(n-pi(n)) >= 1. Since a(n)=n-pi(n)+pi(n-pi(n)) <= n-pi(n-1)+pi(n-pi(n)) <= n-1, we have a(n) < n for n > 1.
a(n)-a(n-1) = 1 - (pi(n)-pi(n-1)) + pi(n-pi(n)) - pi(n-(1+pi(n-1))), where pi(n)-pi(n-1) <= 1 and 1+pi(n-1) >= pi(n) or pi(n-(1+pi(n-1))) <= pi(n-pi(n)). Thus, a(n) - a(n-1) >= 0, meaning that this is a nondecreasing sequence.

Crossrefs

Programs

  • Mathematica
    Array[PrimePi[#] + # &[# - PrimePi[#]] &, 68] (* Michael De Vlieger, Nov 04 2020 *)
  • Python
    from sympy import primepi
    for n in range(1, 10001):
        b = n - primepi(n)
        a = b + primepi(b)
        print(a)

Formula

a(n) = A095117(A062298(n));
a(n) = n - pi(n) + pi(n - pi(n)), where pi(n) is the prime count of n.

A064159 Numbers n such that g(n) + sopfr(n) = n, where g(n)= number of nonprimes <=n (A062298) and sopfr(n) = sum of primes dividing n with repetition (A001414).

Original entry on oeis.org

1, 24, 27, 30, 55, 65, 95, 145, 155, 185, 205, 822, 894, 2779, 2863, 8104, 64270, 174691, 174779, 1301989, 1302457, 3523478, 9554955, 9555045, 9556455, 70111213, 70111247, 514269523, 514269599, 10246934786, 10246934962, 204475046525, 554805817358, 4086199294828
Offset: 1

Views

Author

Jason Earls, Sep 15 2001

Keywords

Comments

That is, numbers n such that primepi(n) = sopfr(n). - Michel Marcus, Mar 25 2017

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local k;
           for k from 1+ `if`(n=1, 0, a(n-1))
           while add(i[1]*i[2], i=ifactors(k)[2])<>pi(k) do od; k
        end:
    seq(a(n), n=1..17);  # Alois P. Heinz, Dec 18 2011
  • Mathematica
    a[n_] := a[n] = Module[{k}, For[k = 1 + If[n==1, 0, a[n-1]], Sum[i[[1]] * i[[2]], {i, FactorInteger[k]}] != PrimePi[k], k++]; k]; a[1] = 1;
    Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 1, 25}] (* Jean-François Alcover, Mar 25 2017, after Alois P. Heinz *)
  • PARI
    sopfr(n) = my(fac=factor(n)); sum(i=1, #fac~, fac[i,1]*fac[i,2]);
    for (n=1,10^6, if (sopfr(n)==primepi(n), print1(n, ", "))) \\ edited by Michel Marcus, Mar 25 2017

Extensions

a(17)-a(21) from Alois P. Heinz, Dec 18 2011
a(22)-a(31) from Donovan Johnson, Jun 29 2012
a(32)-a(34) from Giovanni Resta, Mar 28 2017

A065855 Number of composites <= n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Comments

Also number of primes between prime(n) and n. - Joseph L. Pe, Sep 24 2002
Plot the points (n,a(n)) by, say, appending the line ListPlot[%, PlotJoined -> True] to the Mathematica program. The result is virtually a straight line passing through the origin. For the first thousand points, the slope is approximately = 3/4. (This behavior can be explained by using the prime number theorem.) - Joseph L. Pe, Sep 24 2002
Partial sums of A066247, the characteristic function of composites. - Reinhard Zumkeller, Oct 14 2014

Examples

			Prime(8) = 19 and there are 3 primes between 8 and 19 (endpoints are excluded), namely 11, 13, 17. Hence a(8) = 3.
		

Crossrefs

Cf. A066247.
Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • Haskell
    a065855 n = a065855_list !! (n-1)
    a065855_list = scanl1 (+) (map a066247 [1..])
    -- Reinhard Zumkeller, Oct 20 2014
    
  • Maple
    A065855 := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # N. J. A. Sloane, Oct 20 2024
    a := [seq(A065855(n),n=1..120)];
  • Mathematica
    (*gives number of primes < n*) f[n_] := Module[{r, i}, r = 0; i = 1; While[Prime[i] < n, i++ ]; i - 1]; (*gives number of primes between m and n with endpoints excluded*) g[m_, n_] := Module[{r}, r = f[m] - f[n]; If[PrimeQ[n], r = r - 1]; r]; Table[g[Prime[n], n], {n, 1, 1000}]
    Table[n-PrimePi[n]-1,{n,75}] (* Harvey P. Dale, Jun 14 2011 *)
    Accumulate[Table[If[CompositeQ[n],1,0],{n,100}]] (* Harvey P. Dale, Sep 24 2016 *)
  • PARI
    a(n) = { n - primepi(n) - 1 } \\ Harry J. Smith, Nov 01 2009
    
  • Python
    from sympy import primepi
    def A065855(n):
        return 0 if n < 4 else n - primepi(n) - 1 # Chai Wah Wu, Apr 14 2016

Formula

a(n) = n - A000720(n) - 1 = A062298(n) - 1.

A085970 Number of integers ranging from 2 to n that are not prime-powers.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 06 2003

Keywords

Comments

For n > 2, a(n) gives the number of duplicate eliminations performed by the Sieve of Eratosthenes when sieving the interval [2, n]. - Felix Fröhlich, Dec 10 2016
Number of terms of A024619 <= n. - Felix Fröhlich, Dec 10 2016
First differs from A082997 at n = 30. - Gus Wiseman, Jul 28 2022

Examples

			The a(30) = 13 numbers: 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, 26, 28, 30. - _Gus Wiseman_, Jul 28 2022
		

Crossrefs

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

Programs

  • Mathematica
    With[{nn = 75}, Table[n - Count[#, k_ /; k < n] - 1, {n, nn}] &@ Join[{1}, Select[Range@ nn, PrimePowerQ]]] (* Michael De Vlieger, Dec 11 2016 *)
  • PARI
    a(n) = my(i=0); forcomposite(c=4, n, if(!isprimepower(c), i++)); i \\ Felix Fröhlich, Dec 10 2016
    
  • Python
    from sympy import primepi, integer_nthroot
    def A085970(n): return n-1-sum(primepi(integer_nthroot(n,k)[0]) for k in range(1,n.bit_length())) # Chai Wah Wu, Aug 20 2024

Formula

a(n) = Max{A024619(k)<=n} k;
a(n) = n - A065515(n) = A085972(n) - A000720(n).

Extensions

Name modified by Gus Wiseman, Jul 28 2022. Normally 1 is not considered a prime-power, cf. A000961, A246655.

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

Original entry on oeis.org

1, 2, 0, 2, 1, 0, 3, 1, 2, 0, 3, 4, 4, 6, 1, 4, 4, 17, 9, 11, 0, 5, 11, 18, 54, 21, 27, 0, 6, 16, 47, 59, 176, 47, 53, 1, 6, 23, 68, 195, 204, 610, 118, 133, 0, 7, 23, 119, 315, 898, 769, 2197, 333, 310, 0, 7, 34, 131, 676, 1653, 4353, 3098, 8358, 984, 691, 1, 8, 34, 226, 786, 4078
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...1....1......4......4......11......16.......23.......23........34........34
.0...2....4.....17.....18......47......68......119......131.......226.......237
.0...6....9.....54.....59.....195.....315......676......786......1571......1743
.1..11...21....176....204.....898....1653.....4078.....5075.....11512.....13456
.0..27...47....610....769....4353....9126....25389....33798.....85437....105502
.0..53..118...2197...3098...22189...50166...156454...222665....640886....845325
.1.133..333...8358..14080..112015..266060...972441..1504758...4956259...6973431
.0.310..984..34005..63868..542397.1445197..6288889.10555156..38994996..58337721
.0.691.3362.132483.261240.2658643.8388620.41384162.74476895.308256904.493751257

Examples

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

Crossrefs

Row 1 is A062298(n+2)
Showing 1-10 of 53 results. Next