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

A038377 Number of odd nonprimes <= (2n+1)^2.

Original entry on oeis.org

1, 2, 5, 11, 20, 32, 47, 66, 85, 110, 137, 167, 200, 237, 276, 320, 365, 414, 467, 522, 579, 643, 708, 777, 845, 924, 997, 1080, 1169, 1255, 1343, 1437, 1536, 1637, 1741, 1847, 1961, 2075, 2187, 2311, 2435, 2560, 2691, 2826, 2962, 3104, 3249, 3393, 3543
Offset: 0

Views

Author

Keywords

Examples

			a(2) = 5 because there are 5 odd nonprimes that are not exceeding (2*2+1)^2 = 25: 1, 9, 15, 21 and 25.
		

Crossrefs

Programs

  • Mathematica
    nn=20001; With[{onps=Complement[Range[1,nn,2],Prime[Range[PrimePi[nn+1]]]]}, Table[Count[onps,?(#<=(2n+1)^2&)],{n,0,60}]]  (* _Harvey P. Dale, Apr 13 2011 *)
    a[n_] := 2*n^2 + 2*n + 2 - PrimePi[(2*n + 1)^2]; a[0] = 1; Array[a, 61, 0] (* Amiram Eldar, Sep 06 2024 *)
  • PARI
    a(n) = if(n == 0, 1, 2*n^2 + 2*n + 2 - primepi((2*n + 1)^2)); \\ Amiram Eldar, Sep 06 2024

Formula

a(n) = A037040(n) + 1.
For n>=1, a(n) = 2n^2 + 2n + 2 - PrimePi((2n+1)^2) = A051890(n+1) - A000720((2n+1)^2). - Zak Seidov, Mar 03 2008

Extensions

Offset corrected by Amiram Eldar, Sep 06 2024

A287016 a(n) = smallest number k such that A071904(n) + k^2 is a perfect square.

Original entry on oeis.org

0, 1, 2, 0, 3, 4, 1, 5, 2, 0, 7, 3, 8, 1, 4, 10, 5, 2, 0, 6, 13, 3, 14, 7, 1, 4, 17, 9, 2, 5, 0, 19, 10, 20, 6, 3, 22, 1, 12, 7, 4, 13, 25, 8, 2, 0, 5, 9, 28, 29, 16, 3, 6, 1, 32, 11, 18, 7, 4, 34, 19, 12, 35, 2, 0, 5, 21, 38, 9, 14, 3, 40, 6, 1, 15, 10, 24
Offset: 1

Views

Author

Keywords

Examples

			The third odd composite number is A071904(3) = 21. and 21+2^2 = 25 = 5^2, so a(3) = 2.
		

Crossrefs

Subsequence of A068527.

Programs

  • Mathematica
    q[n_] := SelectFirst[Range[0, (n-1)/2], IntegerQ@ Sqrt[#^2 + n] &]; q /@ Select[Range[1, 300, 2], CompositeQ] (* Giovanni Resta, May 18 2017 *)
  • Python
    from sympy import primepi, divisors
    from sympy.ntheory.primetest import is_square
    def A287016(n):
        if n == 1: return 0
        m, k = n, primepi(n) + n + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n + (k>>1)
        return 0 if is_square(int(m)) else -(d:=divisors(m))[l:=(len(d)>>1)-1]+d[l+1]>>1 # Chai Wah Wu, Aug 02 2024

Formula

a(m) = 0 for m>0 in A037040, the corresponding odd composites being in A016754\{1}. - Michel Marcus, May 19 2017

Extensions

More terms from Giovanni Resta, May 18 2017

A378814 a(n) = round(n/(A000005(A071904(n))-2)).

Original entry on oeis.org

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

Views

Author

Bill McEachen, Dec 08 2024

Keywords

Comments

Nearly all of the data falls on lines discussed below. There are a few "outliers" visible on the graph. There are <120 such outliers in the first 20000 terms (about 0.6%). Many of the outlier indices belong to A037040. The lines are n, (n+0)/2, (n+2)/4, (n+4)/6, (n+6)/8,....

Examples

			Let n=14, A071904(n)=63, tau(63)=6 so a(14)=round(14/(6-2))=4.
		

Crossrefs

Programs

  • Mathematica
    MapIndexed[Floor[#2[[1]]/# + 1/2] &, DivisorSigma[0, Select[Range[9, 500, 2], CompositeQ]] - 2] (* Paolo Xausa, Dec 16 2024 *)
Showing 1-3 of 3 results.