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.

User: Angad Singh

Angad Singh's wiki page.

Angad Singh has authored 10 sequences.

A362222 Slowest increasing sequence where a(n) + n^2 is a prime.

Original entry on oeis.org

1, 3, 4, 7, 12, 17, 18, 19, 20, 27, 28, 29, 30, 31, 32, 37, 42, 43, 48, 49, 50, 57, 58, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 93, 96, 97, 100, 103, 104, 105, 124, 133, 138, 147, 148, 153, 154, 163, 166, 171, 184, 193, 196, 197, 198, 205
Offset: 1

Author

Angad Singh, Apr 11 2023

Keywords

Examples

			a(2) = 3, since the smallest number greater than all the previous terms which gives a prime when added to 2^2 is 3.
		

Crossrefs

Programs

  • Maple
    R:= 1: t:= 1:
    for n from 2 to 100 do
      t:= nextprime(t+n^2)-n^2;
      R:= R,t
    od:
    R; # Robert Israel, Apr 11 2023
  • Mathematica
    a[n_] := a[n] = Module[{k = a[n - 1] + 1}, While[! PrimeQ[n^2 + k], k++]; k]; a[0] = 0; Array[a, 100] (* Amiram Eldar, Apr 12 2023 *)
  • PARI
    seq(n)={my(a=vector(n), p=0); for(n=1, #a, p++; while(!isprime(p+n^2), p++); a[n]=p); a} \\ Andrew Howroyd, Apr 11 2023
    
  • Python
    from sympy import nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        an = 1
        for n in count(2):
            yield an
            an = nextprime(an + n**2) - n**2
    print(list(islice(agen(), 62))) # Michael S. Branicky, Apr 16 2023

A356364 Number of primes p of the form k^2 + 1 less than 10^n such that p+2 and 2p+1 are also primes.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 7, 10, 18, 43, 86, 185, 449, 1091, 2764, 6978, 17951, 47146, 125507, 337600, 916229, 2504458, 6898908
Offset: 1

Author

Angad Singh, Oct 16 2022

Keywords

Examples

			For n = 5, a(5) = 2 since 5 and 25601 are the only two such primes less than or equal to 10^5.
		

Crossrefs

Programs

  • Mathematica
    seq[nmax_] := Module[{c = 0, pow = 10, s = {}, p}, Do[p = k^2 + 1; If[PrimeQ[p] && PrimeQ[p + 2] && PrimeQ[2*p + 1], c++]; If[p > pow, pow *= 10; AppendTo[s, c]], {k, 1, Floor[10^(nmax/2)] + 1}]; s]; seq[13] (* Amiram Eldar, Oct 16 2022 *)

A355778 Numbers k such that both k and k^2 + 2 can be written as the sum of two nonzero squares.

Original entry on oeis.org

40, 68, 72, 104, 148, 180, 320, 392, 468, 544, 612, 648, 720, 788, 832, 900, 936, 968, 1040, 1044, 1156, 1192, 1256, 1300, 1332, 1508, 1732, 1796, 1800, 1832, 1872, 1940, 2056, 2196, 2308, 2336, 2372, 2448, 2664, 2696, 2740, 2804, 2848, 2880, 3060, 3200, 3280
Offset: 1

Author

Angad Singh, Jul 16 2022

Keywords

Comments

The terms in this sequence can be considered as a solution to the "near miss" problem which occurs frequently while solving Diophantine equations. It is known that if a number k can be written as the sum of two nonzero distinct squares then so can k^2 and k^2+1. Thus, finding numbers k such that k^2+2 satisfies the same property makes it quite interesting.

Examples

			40 is a term since 40 = 2^2 + 6^2 as well as 40^2 + 2 = 1602 = 9^2 + 39^2.
320 is a term since 320 = 8^2 + 16^2 as well as 320^2 + 2 = 102402 = 201^2 + 249^2.
		

Crossrefs

Programs

  • PARI
    is1(n)= for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2)); \\ A000404
    isok(k) = is1(k) && is1(k^2+2); \\ Michel Marcus, Jul 18 2022
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A355778_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue, 1)):
            c = False
            for p in (f:=factorint(n)):
                if (q:= p & 3)==3 and f[p]&1:
                    break
                elif q == 1:
                    c = True
            else:
                if c or f.get(2, 0)&1:
                    c = False
                    for p in (f:=factorint(n**2+2)):
                        if (q:= p & 3)==3 and f[p]&1:
                            break
                        elif q == 1:
                            c = True
                    else:
                        if c or f.get(2, 0)&1:
                            yield n
    A355778_list = list(islice(A355778_gen(),30)) # Chai Wah Wu, Sep 14 2022

A355769 Numbers k such that both k and k+1 can be written as the sum of two nonzero squares.

Original entry on oeis.org

17, 25, 40, 52, 72, 73, 89, 97, 100, 116, 136, 145, 148, 169, 180, 193, 225, 232, 233, 241, 244, 260, 288, 289, 292, 305, 313, 337, 369, 388, 400, 404, 409, 424, 449, 457, 481, 520, 521, 544, 548, 577, 584, 585, 592, 612, 625, 628, 640, 656, 673, 676, 697, 724
Offset: 1

Author

Angad Singh, Jul 16 2022

Keywords

Comments

The numbers in the sequence are useful in solving various second-degree Diophantine equations.
The identity (3n-12)^2 + (4n-12)^2 + 1 = (3n-8)^2 + (4n-15)^2 proves that there are infinitely many such numbers in this sequence.

Examples

			17 is a term since 17 = 4^2 + 1^2 and 17 + 1 = 18 = 3^2 + 3^2.
169 is a term since 169 = 5^2 + 12^2 and 169 + 1 = 170 = 1^2 + 13^2.
		

Crossrefs

Programs

  • PARI
    is1(n)= for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2)); \\ A000404
    isok(k) = is1(k) && is1(k+1); \\ Michel Marcus, Jul 18 2022

A354626 Numbers that can't be written as the sum of a Fibonacci number and the square of a Fibonacci number.

Original entry on oeis.org

15, 16, 18, 19, 20, 23, 24, 29, 31, 32, 36, 37, 39, 40, 41, 42, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 57, 58, 60, 61, 62, 63, 68, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82, 83, 84, 86, 87, 88, 91, 92, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 115
Offset: 1

Author

Angad Singh, Jul 09 2022

Keywords

Examples

			16 is a term since there does not exist any pair of integers i,j >= 0 such that Fibonacci(i) + Fibonacci(j)^2 = 16.
		

Crossrefs

Formula

Numbers k such that the coefficient of x^k in the product (Sum_{i>=0} x^Fibonacci(i)) * (Sum_{j>=0} x^(Fibonacci(j)^2)) is 0.

A347934 Primes p of the form k^2 + 1 such that p+2 and 2p+1 are also prime.

Original entry on oeis.org

5, 25601, 193601, 1144901, 1464101, 4326401, 6100901, 12390401, 23522501, 72931601, 127012901, 245862401, 256960901, 351937601, 441840401, 732784901, 802588901, 951722501, 1621672901, 2024100101, 2070250001, 2217468101, 2219352101, 2428518401, 2930056901, 2963713601
Offset: 1

Author

Angad Singh, Sep 20 2021

Keywords

Comments

All primes (except 5) in the sequence are of the form 100*k^2 + 1.

Crossrefs

Intersection of A002496 and A045536.

Programs

  • Mathematica
    Select[Range[50000]^2 + 1, AllTrue[{#, # + 2, 2*# + 1}, PrimeQ] &] (* Amiram Eldar, Sep 20 2021 *)

A347932 Least m such that the first n digits (after the decimal point) of e and Sum_{k=0..m} 1/k! are the same.

Original entry on oeis.org

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

Author

Angad Singh, Sep 20 2021

Keywords

Crossrefs

Cf. A001113.

Programs

  • Mathematica
    a[n_] := Module[{e = Floor[10^n*E], s = 0, k = 0}, While[Floor[10^n*s] != e, s += 1/k!; k++]; k - 1]; Array[a, 65] (* Amiram Eldar, Sep 20 2021 *)

A347038 Primes p such that there are no solutions to d(k+p) = sigma(k).

Original entry on oeis.org

29, 37, 41, 53, 67, 89, 101, 109, 113, 127, 137, 151, 157, 173, 181, 197, 227, 229, 233, 257, 269, 277, 281, 293, 313, 349, 373, 389, 401, 409, 421, 439, 461, 557, 587, 593, 601, 613, 617, 641, 643, 653, 661, 673, 677, 701, 709, 739, 761, 773, 787, 821, 829
Offset: 1

Author

Angad Singh, Aug 12 2021

Keywords

Comments

If p is not in the sequence and d(k+p) = sigma(k), then k <= 1+2*sqrt(p). Proof: We have d(m) <= 2*sqrt(m) (see formula in A000005), so 2*sqrt(k+p) >= d(k+p) = sigma(k) >= k+1 (if k > 1). After squaring and simplifying, we get k <= 1+2*sqrt(p). - Pontus von Brömssen, Aug 20 2021

Crossrefs

Programs

  • Maple
    filter:= proc(p) isprime(p) and not ormap(k -> numtheory:-tau(k+p) = numtheory:-sigma(k), [$1 .. 1 + 2*isqrt(p)]) end proc:
    select(filter, [seq(i,i=3..1000,2)]); # Robert Israel, Aug 06 2025
  • Python
    from sympy import divisor_count as d, divisor_sigma as sigma, primerange
    from math import isqrt
    def A347038_list(pmax):
        a = []
        for p in primerange(2, pmax + 1):
            if not any(d(k + p) == sigma(k) for k in range(1, 2 + isqrt(4 * p))):
                a.append(p)
        return a  # Pontus von Brömssen, Aug 20 2021

A345746 Decimal expansion of Pi^(-1/9).

Original entry on oeis.org

8, 8, 0, 5, 6, 4, 4, 0, 3, 4, 5, 2, 2, 1, 5, 0, 9, 5, 3, 2, 6, 6, 6, 4, 7, 9, 1, 9, 4, 5, 0, 0, 8, 6, 3, 5, 4, 7, 5, 2, 4, 9, 8, 8, 6, 7, 4, 0, 3, 8, 1, 1, 8, 6, 3, 5, 7, 7, 5, 1, 4, 0, 8, 3, 9, 2, 6, 7, 6, 7, 4, 8, 7, 5, 9, 4, 6, 3, 1, 5, 1, 3, 1, 0, 0, 2, 3, 7, 9, 9, 6, 3
Offset: 0

Author

Angad Singh, Jun 25 2021

Keywords

Examples

			0.880564403452215095326664791945008635475249886...
		

Crossrefs

Cf. A000796 (Pi), A049541 (1/Pi), A093209 (Pi^(-1/8)).

Programs

  • Mathematica
    RealDigits[Pi^(-1/9), 10, 100][[1]] (* Amiram Eldar, Jun 29 2021 *)

A344209 Decimal expansion of zeta(sqrt(2)).

Original entry on oeis.org

3, 0, 2, 0, 7, 3, 7, 6, 7, 9, 4, 8, 6, 0, 3, 2, 6, 6, 8, 2, 7, 0, 9, 9, 2, 2, 8, 3, 7, 0, 0, 4, 0, 9, 0, 1, 8, 6, 5, 3, 6, 7, 7, 5, 9, 6, 4, 5, 8, 3, 7, 2, 6, 9, 9, 7, 7, 9, 7, 9, 1, 9, 1, 6, 3, 9, 3, 0, 4, 1, 0, 5, 8, 0, 7, 5, 2, 6, 8, 9, 9, 8, 8, 6, 1, 9, 1, 8, 9, 3, 0, 6, 0, 9, 7, 8, 7, 2, 7, 2, 1, 7, 6, 5, 8, 5, 7, 9
Offset: 1

Author

Angad Singh, May 12 2021

Keywords

Examples

			3.0207376794860326682709922837004090186536775964583726997797919163...
		

Crossrefs

Cf. A002193.

Programs

  • Mathematica
    RealDigits[Zeta[Sqrt[2]], 10, 120][[1]] (* Amiram Eldar, Jun 12 2023 *)
  • PARI
    zeta(sqrt(2)) \\ Michel Marcus, Jun 15 2021

Formula

Equals Sum_{k>=1} 1/k^(sqrt(2)).