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.

Previous Showing 41-50 of 59 results. Next

A260157 Smallest term of the first run of at least n consecutive integers which are not sums of 2 squares.

Original entry on oeis.org

3, 6, 21, 21, 75, 91, 186, 378, 987, 987, 1494, 1494, 1494, 1494, 5166, 5166, 5166, 5166, 16110, 16869, 31658, 31658, 31658, 52394, 101350, 101350, 101350, 105573, 241883, 241883, 284003, 284003, 284003, 685542, 1437354, 1751297, 1853867, 1853867, 1853867, 1853867, 1853867, 1853867, 1853867, 1853867, 1853867, 1853867, 1853867
Offset: 1

Views

Author

Ivan Neretin, Nov 09 2015

Keywords

Examples

			None of 21, 22, 23, and 24 is representable as a sum of two squares. Previous record of run length was 2, hence a(3)=a(4)=21.
		

Crossrefs

Cf. A022544.

Programs

  • Mathematica
    t = Select[Range[10^4], SquaresR[2, #] == 0 &]; SelectFirst[t, Function[n, ContainsAll[t, n + Range@ #]]] & /@ Range[0, 15] (* Michael De Vlieger, Nov 09 2015, Version 10.2 *)

A261604 a(1)=0. For n>1, a(n) = smallest number > a(n-1) such that, for all m,r

Original entry on oeis.org

0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 33, 35, 38, 39, 40, 42, 43, 44, 46, 47, 48, 51, 53, 54, 55, 56, 57, 59, 60, 62, 63, 66, 67, 68, 69, 70, 71, 75, 76, 77, 78, 79, 81, 82, 83, 84, 86, 87, 88
Offset: 1

Views

Author

Anders Hellström, Aug 25 2015

Keywords

Crossrefs

A022544 is a subsequence.

Programs

  • PARI
    issumsq(n,r,s)=(r^2)+(s^2)==n
    first(m)=my(v=vector(m), x, r, n, s); v[1]=0; for(n=2, m, v[n]=v[n-1]+1;until(x==1, for(r=1, n-1, for(s=1, n-1, if(issumsq(v[n],v[r],v[s]), v[n]++; x=0; break(2), x=1))))); v;
    
  • PARI
    isA022544(n)=if(n%4==3, return(1)); my(f=factor(n)); for(i=1,#f~, if(f[i,1]%4==3 && f[i,2]%2, return(1))); 0
    search(v,x)=my(t=setsearch(v,x)); if(t, t, setsearch(v,x,1))
    list(lim)=my(v=List([0,1]),t); for(n=3,lim, if(isA022544(n), listput(v,n); next); for(j=search(v,sqrtint((n-1)\2)+1),search(v,sqrtint(n)), if(issquare(n-v[j]^2, &t) && setsearch(v,t), next(2))); listput(v,n)); Set(v) \\ Charles R Greathouse IV, Sep 01 2015

Formula

a(n) ~ n, and in particular a(n) = n + O(n/sqrt(log n)). I do not know if this bound is tight. - Charles R Greathouse IV, Sep 01 2015

A264101 Numbers that can't be represented as the sum of two squares, two triangular numbers, or a square and a triangular number.

Original entry on oeis.org

23, 33, 47, 62, 63, 86, 118, 134, 138, 143, 158, 167, 188, 195, 203, 204, 209, 223, 230, 243, 248, 275, 283, 294, 318, 323, 348, 368, 383, 385, 395, 398, 408, 411, 413, 418, 419, 426, 437, 440, 448, 454, 467, 473, 476, 489, 492, 503, 508, 518, 523, 558, 563, 566, 572, 608
Offset: 1

Views

Author

Alex Ratushnyak, Nov 03 2015

Keywords

Comments

Intersection of A014134, A020757, A022544.

Examples

			Since 22 = 16+6, because 16 is a square and 6 is a triangular number, 22 is not a term.
23 is a term because there is no representation as S+T or S1+S2 or T1+T2, where S, S1, S2 are squares, and T, T1, T2 are triangular numbers.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms <= N
    S:= [seq(i^2,i=0..floor(sqrt(N)))]: nS:= nops(S):
    T:= [seq(i*(i+1)/2, i=0..floor(sqrt(2*N)))]: nT:= nops(T):
    sort(convert({$1..N} minus {seq(seq(S[i]+S[j], j=1..i),i=1..nS),
    seq(seq(S[i]+T[j],i=1..nS),j=1..nT),
    seq(seq(T[i]+T[j],j=1..i),i=1..nT)}, list)); # Robert Israel, May 19 2020
  • Mathematica
    mx = 610; Complement[ Range@ mx, Union@ Flatten@ Table[{i^2 + j^2, i(i + 1)/2 + j^2, i(i + 1)/2 + j(j + 1)/2}, {i, 0, Sqrt[2 mx]}, {j, 0, Sqrt[2 mx]}]] (* Robert G. Wilson v, Nov 29 2015 *)

A297350 Start of record gaps between sums of two squares.

Original entry on oeis.org

0, 2, 5, 20, 74, 90, 185, 377, 986, 1493, 5165, 16109, 16868, 31657, 52393, 101349, 105572, 241882, 284002, 685541, 1437353, 1751296, 1853866, 5588305, 9565544, 13305524, 20875482, 67070173, 135628357, 192085714, 264428585, 345869506, 426063725, 434120338, 672657850
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form A001481(i) such that the difference A001481(i+1)-A001481(i) reaches record values, where i is the index of a(n) in A001481. - Felix Fröhlich, Jan 09 2018

Examples

			20 = 4^2 + 2^2 and 25 = 5^2 + 0^2 are both sums of two squares, but none of 21, 22, 23, or 24 are, and no previous gap is as long as 25 - 20 = 5.
		

Crossrefs

Programs

  • Mathematica
    Block[{s = Select[Range[0, 10^6], SquaresR[2, #] != 0 &], t}, t = Differences@ s; s[[First@ FirstPosition[t, #] ]] & /@ Union@ FoldList[Max, t]] (* Michael De Vlieger, Jan 09 2018 *)
  • PARI
    is2(f)=for(i=if(f[1,1]==2,2,1),#f~, if(bitand(f[i,2],1)==1 && bitand(f[i,1],3)==3, return(0))); 1
    print1(r=0); last=2; forfactored(n=last+1,10^9, if(!is2(n[2]), next); t=n[1]-last; if(t>r, r=t; print1(", "last)); last=n[1])

A343992 Number of grid-filling curves of order n (on the square grid) with turns by +-90 degrees generated by folding morphisms that are perfect.

Original entry on oeis.org

0, 1, 0, 1, 3, 0, 0, 6, 3, 20, 0, 0, 29, 0, 0, 56, 101, 108, 0, 392
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2021

Keywords

Comments

Curves of order n generated by folding morphisms are walks on the square grid, also coded by sequences (starting with D) of n-1 U's and D's starting with D, the Up and Down folds. These are also known as n-folds. In the square grid they uniquely correspond to folding morphisms, which are a special class of morphisms sigma on the alphabet {a,b,c,d}. (There is in particular the requirement that sigma(a) = ab...). Here the letters a,b,c, and d correspond to the four possible steps of the walk. A curve C = C1 of order n generates curves Cj of order n^j by the process of iterated folding. Iterated folding corresponds to iterates of the folding morphism. Grid-filling or plane-filling means that all the points in arbitrary large balls of gridpoints are eventually visited by the Cj. Perfect means that four 90-degree rotated copies of the curves Cj started at the origin will pass exactly twice through all grid-points as j tends to infinity (except the origin itself).
It is a theorem that a(A022544(n)) = 0, and a(A001481(n)) > 0 for n>2.

Examples

			For n=2 one obtains Heighway's dragon curve, with folding morphism sigma: a -> ab, b -> cb, c -> cd, d -> ad (see A105500 or A246960).
		

References

  • Chandler Davis and Donald E. Knuth, Number Representations and Dragon Curves -- I and II, Journal of Recreational Mathematics, volume 3, number 2, April 1970, pages 66-81, and number 3, July 1970, pages 133-149. Reprinted and updated in Donald E. Knuth, Selected Papers on Fun and Games, CSLI Publications, 2010, pages 571-614.

Crossrefs

Extensions

Renamed and rewritten by Michel Dekking, Jun 03 2021

A356809 Fibonacci numbers which are not the sum of two squares.

Original entry on oeis.org

3, 21, 55, 987, 2584, 6765, 17711, 46368, 317811, 832040, 2178309, 5702887, 14930352, 102334155, 267914296, 701408733, 1836311903, 4807526976, 12586269025, 32951280099, 86267571272, 225851433717, 591286729879, 1548008755920, 10610209857723
Offset: 1

Views

Author

Ctibor O. Zizka, Aug 29 2022

Keywords

Examples

			F(4) = 3; 3 != x^2 + y^2 as no positive integers x, y >= 0 are the solution of this Diophantine equation.
		

Crossrefs

Intersection of A000045 and A022544.

Programs

  • Mathematica
    Select[Fibonacci[Range[65]], SquaresR[2, #] == 0 &] (* Amiram Eldar, Aug 29 2022 *)
  • PARI
    is(n)=if(n%4==3, return(1)); my(f=factor(n)); for(i=1, #f~, if(f[i, 1]%4==3 && f[i, 2]%2, return(1))); 0; \\ A022544
    lista(nn) = select(is, apply(fibonacci, [1..nn])); \\ Michel Marcus, Sep 04 2022
    
  • Python
    from itertools import islice
    from sympy import factorint
    def A356809_gen(): # generator of terms
        a, b = 1, 2
        while True:
            if any(p&3==3 and e&1 for p, e in factorint(a).items()):
                yield a
            a, b = b, a+b
    A356809_list = list(islice(A356809_gen(),30)) # Chai Wah Wu, Jan 10 2023

A362961 a(n) = Sum_{b=0..floor(sqrt(n)), n-b^2 is square} b.

Original entry on oeis.org

1, 1, 0, 2, 3, 0, 0, 2, 3, 4, 0, 0, 5, 0, 0, 4, 5, 3, 0, 6, 0, 0, 0, 0, 12, 6, 0, 0, 7, 0, 0, 4, 0, 8, 0, 6, 7, 0, 0, 8, 9, 0, 0, 0, 9, 0, 0, 0, 7, 13, 0, 10, 9, 0, 0, 0, 0, 10, 0, 0, 11, 0, 0, 8, 20, 0, 0, 10, 0, 0, 0, 6, 11, 12, 0, 0, 0, 0, 0, 12, 9, 10, 0
Offset: 1

Views

Author

Darío Clavijo, May 10 2023

Keywords

Comments

a(n) = 0 if n in A022544.
a(n) > 0 if n in A001481.

Crossrefs

Cf. A143574 (sum of b^2), A000925.

Programs

  • Mathematica
    a[n_]:=Sum[b Boole[IntegerQ[Sqrt[n-b^2]]],{b,0,Floor[Sqrt[n]]}]; Array[a,83] (* Stefano Spezia, May 15 2023 *)
  • PARI
    a(n) = sum(b=0, sqrtint(n), if (issquare(n-b^2), b)); \\ Michel Marcus, May 16 2023
  • Python
    from gmpy2 import *
    a = lambda n: sum([b for b in range(0, isqrt(n) + 1) if is_square(n - (b*b))])
    print([a(n) for n in range(1, 84)])
    
  • Python
    from sympy import divisors
    from sympy.solvers.diophantine.diophantine import cornacchia
    def A362961(n):
        c = 0
        for d in divisors(n):
            if (k:=d**2)>n:
                break
            q, r = divmod(n,k)
            if not r:
                c += sum(d*(a[0]+(a[1] if a[0]!=a[1] else 0)) for a in cornacchia(1,1,q) or [])
        return c # Chai Wah Wu, May 15 2023
    

A363051 a(n) = Sum_{b=0..floor(sqrt(n/2)), n-b^2 is square} b.

Original entry on oeis.org

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

Views

Author

Darío Clavijo, May 14 2023

Keywords

Comments

a(n) = 0 if n in A022544.
a(n) > 0 if n in A001481.

Crossrefs

Programs

  • Maple
    A363051 := proc(n)
        local x,a ;
        a := 0 ;
        for x from 1 do
            if x^2 > n/2 then
                return a;
            end if;
            if issqr(n-x^2) then
                a := a+x ;
            end if;
        end do:
    end proc:
    seq(A363051(n),n=1..100) ; # R. J. Mathar, Jan 31 2024
  • Mathematica
    a[n_]:=Sum[b Boole[IntegerQ[Sqrt[n-b^2]]],{b,0,Floor[Sqrt[n/2]]}]; Array[a,83] (* Stefano Spezia, May 15 2023 *)
  • Python
    from gmpy2 import *
    a = lambda n: sum([b for b in range(0, isqrt(n >> 1) + 1) if is_square(n - (b*b))])
    print([a(n) for n in range(1, 84)])
    
  • Python
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A363051(n): return sum(min(a) for a in diop_DN(-1,n))>>1 # Chai Wah Wu, May 16 2023

A034026 Numbers that are primitively or imprimitively represented by x^2+y^2, but not both.

Original entry on oeis.org

1, 2, 4, 5, 8, 9, 10, 13, 16, 17, 18, 20, 26, 29, 32, 34, 36, 37, 40, 41, 45, 49, 52, 53, 58, 61, 64, 65, 68, 72, 73, 74, 80, 81, 82, 85, 89, 90, 97, 98, 100, 101, 104, 106, 109, 113, 116, 117, 121, 122, 128, 130, 136, 137, 144, 145, 146, 148, 149, 153
Offset: 1

Views

Author

Keywords

Crossrefs

A071010 Sigma(k)/4 when k is not a sum of 2 squares.

Original entry on oeis.org

1, 3, 2, 3, 7, 6, 6, 5, 8, 9, 6, 15, 10, 14, 18, 8, 12, 12, 15, 14, 24, 11, 21, 18, 12, 31, 18, 30, 18, 30, 20, 15, 42, 24, 26, 36, 17, 24, 36, 18, 31, 35, 24, 42, 20, 21, 56, 33, 30, 45, 28, 42, 32, 36, 30, 63, 39, 54, 26, 48, 27, 70, 54, 38, 62, 60, 36, 45, 36, 90, 42, 56, 78
Offset: 1

Views

Author

Benoit Cloitre, May 19 2002

Keywords

Comments

Conjecture : if n is not the sum of 2 squares sigma(n) == 0 (mod 4) (converse is not true : if sigma(n) == 0 (mod 4), n is sometimes the sum of 2 squares : sigma(65) = 84 == 0 (mod 4) but 65 = 49+16 is a sum of 2 squares).

Crossrefs

Programs

  • Mathematica
    DivisorSigma[1, Select[Range[120], SquaresR[2, #] == 0 &]]/4  (* Amiram Eldar, May 13 2022 *)
  • PARI
    for(n=0,200,if(sum(i=0,n,sum(j=0,i,if(i^2+j^2-n,0,1)))==0,print1(sigma(n)/4,",")))

Formula

a(n) = sigma(A022544(n))/4.
Previous Showing 41-50 of 59 results. Next