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 64 results. Next

A138609 List the first term from A042963, then 2 terms from A014601 (starting from 3), 3 terms from A042963, 4 terms from A014601, etc.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, May 14 2008

Keywords

Comments

The original name was "Generalized Connell sequence". However, this sequence has only a passing resemblance to Connell-like sequences (see A001614 and the paper by Iannucci & Mills-Taylor), which are all monotone, while this sequence is a bijection of natural numbers.
The sequence is formed by concatenating subsequences S1,S2,S3,..., each of finite length. The subsequence S1 consists of the element 1. The n-th subsequence has n elements. Each subsequence is nondecreasing. The difference between two consecutive elements in the same subsequence is varying, but >= 1.

Examples

			Let us separate natural numbers into two disjoint sets (A042963 and A014601):
  1,2,5,6,9,10,13,14,17,18,21,22,25,26,29,30,...
  3,4,7,8,11,12,15,16,19,20,23,24,27,28,31,32,...
then
  S1={1}
  S2={3,4}
  S3={2,5,6,}
  S4={7,8,11,12}
  S5={9,10,13,14,17}
  ...
  and concatenating S1/S2/S3/S4/S5/... gives this sequence.
		

Crossrefs

Formula

a(n) = A116966(A074147(n)-1). - Antti Karttunen, Oct 05 2009

Extensions

Edited, extended and keyword tabl added by Antti Karttunen, Oct 05 2009

A191664 Dispersion of A014601 (numbers >2, congruent to 0 or 3 mod 4), by antidiagonals.

Original entry on oeis.org

1, 3, 2, 7, 4, 5, 15, 8, 11, 6, 31, 16, 23, 12, 9, 63, 32, 47, 24, 19, 10, 127, 64, 95, 48, 39, 20, 13, 255, 128, 191, 96, 79, 40, 27, 14, 511, 256, 383, 192, 159, 80, 55, 28, 17, 1023, 512, 767, 384, 319, 160, 111, 56, 35, 18, 2047, 1024, 1535, 768, 639
Offset: 1

Views

Author

Clark Kimberling, Jun 11 2011

Keywords

Comments

Row 1: A000225 (-1+2^n)
Row 2: A000079 (2^n)
Row 3: A055010
Row 4: 3*A000079
Row 5: A153894
Row 6: 5*A000079
Row 7: A086224
Row 8: A005009
Row 9: A052996
For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191663=dispersion of A042948 (0 or 1 mod 4 and >1)
A054582=dispersion of A005843 (0 or 2 mod 4 and >1; evens)
A191664=dispersion of A014601 (0 or 3 mod 4 and >1)
A191665=dispersion of A042963 (1 or 2 mod 4 and >1)
A191448=dispersion of A005408 (1 or 3 mod 4 and >1, odds)
A191666=dispersion of A042964 (2 or 3 mod 4)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191663 has 1st col A042964, all else A042948
A054582 has 1st col A005408, all else A005843
A191664 has 1st col A042963, all else A014601
A191665 has 1st col A014601, all else A042963
A191448 has 1st col A005843, all else A005408
A191666 has 1st col A042948, all else A042964
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.
This sequence is a permutation of the natural numbers. - L. Edson Jeffery, Aug 13 2014

Examples

			Northwest corner:
1...3...7....15...31
2...4...8....16...32
5...11..23...47...95
6...12..24...48...96
9...19..39...79...159
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 3; b = 4; m[n_] := If[Mod[n, 2] == 0, 1, 0];
    f[n_] := a*m[n + 1] + b*m[n] + 4*Floor[(n - 1)/2]
    Table[f[n], {n, 1, 30}]  (* A014601(n+2): (4+4k,5+4k) *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191664 *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191664  *)
    (* Clark Kimberling, Jun 11 2011 *)
    Grid[Table[2^k*(2*Floor[(n + 1)/2] - 1) - Mod[n, 2], {n, 12}, {k, 12}]] (* L. Edson Jeffery, Aug 13 2014 *)

A006371 Number of positive definite reduced binary quadratic forms of discriminant -A014601(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 3, 2, 2, 2, 3, 3, 2, 3, 4, 2, 1, 4, 5, 4, 2, 2, 4, 4, 3, 4, 5, 4, 1, 4, 7, 3, 3, 4, 5, 6, 3, 4, 6, 2, 2, 6, 8, 6, 3, 3, 5, 6, 3, 6, 8, 4, 2, 6, 10, 4, 2, 6, 5, 7, 5, 4, 8, 4, 3, 8, 10, 8, 3, 2, 7, 6, 4, 8, 10, 6, 1, 8
Offset: 1

Views

Author

Keywords

Examples

			For n = 6, the a(6) = 2 positive definite reduced binary quadratic forms of discriminant -A014601(6) = -12 are x^2 + 3*y^2 and 2*x^2 + 2*x*y + 2*y^2.  For n = 7, the a(7) = 2 positive definite reduced binary quadratic forms of discriminant -A014601(7) = -15 are x^2 + x*y + 4*y^2 and 2*x^2 + x*y + 2*y^2. For n = 8, the a(8) = 2 positive definite reduced binary quadratic forms of discriminant -A014601(8) = -16 are x^2 + 4*y^2 and 2*x^2 + 2*y^2. - _Robin Visser_, May 29 2025
		

References

  • H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 5th edition, 1982, p. 144.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • SageMath
    def a(n):
        D, ans = 2*n+1-(n+1)%2, 0
        for b in range(-isqrt(D/3), isqrt(D/3)+1):
            if ((D+b^2)%4 != 0): continue
            for a in Integer((D+b^2)/4).divisors():
                if ((abs(b)==a) or (a^2==(D+b^2)/4)) and (b < 0): continue
                if (a >= abs(b)) and (a^2 <= (D+b^2)/4): ans += 1
        return ans  # Robin Visser, May 29 2025

Formula

a(2*n) = A006374(n) for all n > 0. - Robin Visser, May 29 2025

Extensions

More terms from Sean A. Irvine, Mar 19 2017
Name clarified and offset corrected by Robin Visser, May 29 2025

A329648 Let D = A014601(n) be the n-th positive integer congruent to 0 or 3 mod 4, then a(n) = b(D) := -Sum_{i=1..D} Kronecker(-D,i)*i, where Kronecker(-D,i) is the Kronecker symbol.

Original entry on oeis.org

1, 2, 7, 8, 11, 8, 30, 8, 19, 40, 69, 48, 9, 0, 93, 32, 70, 36, 156, 80, 43, 88, 235, 32, 102, 104, 220, 224, 177, 0, 126, 32, 67, 272, 497, 0, 50, 152, 395, 160, 249, 336, 522, 176, 182, 0, 760, 192, 0, 0, 515, 624, 321, 72, 888, 0, 230, 696, 1190, 480, 246, 0, 635
Offset: 1

Views

Author

Jianing Song, Nov 18 2019

Keywords

Comments

Note that {Kronecker(D,i)} is a Dirichlet character mod |D| if and only if D == 0, 1 (mod 4).
We have the identity: -Sum_{i=1..D} Kronecker(-D,i)*i^2 = D*b(D). Proof: -Sum_{i=1..D} Kronecker(-D,i)*i^2 = -(1/2)*Sum_{i=1..D} (Kronecker(-D,i)*i^2+Kronecker(-D,D-i)*(D-i)^2) = -(1/2)*Sum_{i=1..D} (Kronecker(-D,i)*(i^2-(D-i)^2)) = -(1/2)*Sum_{i=1..D} (Kronecker(-D,i)*(2*D*i-D^2) = D*b(D) + (D^2/2)*(Sum_{i=1..D} Kronecker(-D,i)) = D*b(D).

Examples

			For n = 7, D = 15, b(15) = -(1 + 2 + 4 - 7 + 8 - 11 - 13 - 14) = 30, which is equal to 15*h(-15). Note that the class number of Q[sqrt(-15)] is 2.
For D < 100, b(D) = 0 for D = 28 = 7*2^2, 60 = 15*2^2, 72 = 8*3^2, 92 = 23*2^2, 99 = 11*3^2 and 100 = 4*5^2, where -7, -15, -8, -23, -11 and -4 are fundamental discriminants. Note that Kronecker(-7,2) = Kronecker(-15,2) = Kronecker(-8,3) = Kronecker(-23,2) = Kronecker(-11,3) = 1. On the other hand, for D = 213444 = 4*231^2, we have c(213444) = 2*h(-4)/w(-4) * (1-Kronecker(-4,3))*(1-Kronecker(-4,7))*(1-Kronecker(-4,11)) = 4 and b(213444) = 213444*4 = 853776.
		

Crossrefs

Programs

  • Mathematica
    b[n_] = -Sum[KroneckerSymbol[n, i]*i, {i, 1, n}];
    a[n_] = b[2 n + Mod[n, 2]]
  • PARI
    b(n) = -sum(i=1, n, kronecker(-n,i)*i)
    a(n) = b(2*n + (n%2))

Formula

Let c(D) = b(D)/D = -(1/D)*(Sum_{i=1..D} Kronecker(-D,i)*i). Let -d be the unique fundamental discriminant (i.e., d is in A003657) such that D/d is a square, then c(D) = 2*h(-d)/w(-d) * Product_{primes p|D} (1-Kronecker(-d,p)), where h(-d) is the class number of K = Q[sqrt(-d)], w(-d) is the number of elements in K whose norms are 1 (w(-d) = 6 if d = 3, 4 if d = 4 and 2 if d > 4). This can be seen as the generalization of the well known class number formula: if -d is a fundamental discriminant then c(d) = 2*h(-d)/w(-d). See my notes in the Links section.
b(D) = 0 if and only if there exists a prime p being a factor of D such that if we write D = p^e * s, gcd(p,s) = 1, then e is even and Kronecker(-s,p) = 1; if p = 2, then s == 7 (mod 8).
If -d is a fundamental discriminant, then Sum_{k>=1} Kronecker(-d,k)/k = 2*Pi*h(-d)/(sqrt(d)*w(-d)) = Pi*c(d)/sqrt(d) = Pi*b(d)/d^(3/2). Here Sum_{k>=1} Kronecker(-d,k)/k is the value of the Dirichlet L-series of a non-principal character modulo d at s=1.

A276150 Sum of digits when n is written in primorial base (A049345); minimal number of primorials (A002110) that add to n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

The sum of digits of n in primorial base is odd if n is 1 or 2 (mod 4) and even if n is 0 or 3 (mod 4). Proof: primorials are 1 or 2 (mod 4) and a(n) can be constructed via the greedy algorithm. So if n = 4k + r where 0 <= r < 4, 4k needs an even number of primorials and r needs hammingweight(r) = A000120(r) primorials. Q.E.D. - David A. Corneth, Feb 27 2019

Examples

			For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), the sum of digits is 4, thus a(24) = 4.
		

Crossrefs

Cf. A333426 [k such that a(k)|k], A339215 [numbers not of the form x+a(x) for any x], A358977 [k such that gcd(k, a(k)) = 1].
Cf. A014601, A042963 (positions of even and odd terms), A343048 (positions of records).
Differs from analogous A034968 for the first time at n=24.

Programs

  • Mathematica
    nn = 120; b = MixedRadix[Reverse@ Prime@ NestWhileList[# + 1 &, 1, Times @@ Prime@ Range[# + 1] <= nn &]]; Table[Total@ IntegerDigits[n, b], {n, 0, nn}] (* Version 10.2, or *)
    nn = 120; f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Total@ f@ n, {n, 0, 120}] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    A276150(n) = { my(s=0, p=2, d); while(n, d = (n%p); s += d; n = (n-d)/p; p = nextprime(1+p)); (s); }; \\ Antti Karttunen, Feb 27 2019
  • Python
    from sympy import prime, primefactors
    def Omega(n): return 0 if n==1 else Omega(n//primefactors(n)[0]) + 1
    def a276086(n):
        i=0
        m=pr=1
        while n>0:
            i+=1
            N=prime(i)*pr
            if n%N!=0:
                m*=(prime(i)**((n%N)/pr))
                n-=n%N
            pr=N
        return m
    def a(n): return Omega(a276086(n))
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 23 2017
    

Formula

a(n) = 1 + a(A276151(n)) = 1 + a(n-A002110(A276084(n))), a(0) = 0.
or for n >= 1: a(n) = 1 + a(n-A260188(n)).
Other identities and observations. For all n >= 0:
a(n) = A001222(A276086(n)) = A001222(A278226(n)).
a(n) >= A371091(n) >= A267263(n).
From Antti Karttunen, Feb 27 2019: (Start)
a(n) = A000120(A277022(n)).
a(A283477(n)) = A324342(n).
(End)
a(n) = A373606(n) + A373607(n). - Antti Karttunen, Jun 19 2024

A042963 Numbers congruent to 1 or 2 mod 4.

Original entry on oeis.org

1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, 22, 25, 26, 29, 30, 33, 34, 37, 38, 41, 42, 45, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66, 69, 70, 73, 74, 77, 78, 81, 82, 85, 86, 89, 90, 93, 94, 97, 98, 101, 102, 105, 106, 109, 110, 113, 114, 117, 118, 121, 122, 125, 126, 129, 130, 133, 134, 137, 138
Offset: 1

Views

Author

Keywords

Comments

Complement of A014601. - Reinhard Zumkeller, Oct 04 2004
Let S(x) = (1, 2, 2, 2, ...). Then A042963 = ((S(x))^2 + S(x^2))/2 = ((1, 4, 8, 12, 16, 20, ...) + (1, 0, 2, 0, 2, 0, 2, ...))/2 = (1, 2, 5, 6, 9, 10, ...). - Gary W. Adamson, Jan 03 2011
(a(n)*(a(n) + 1 + 4*k))/2 is odd, for k >= 0. - Gionata Neri, Jul 19 2015
Equivalent to the following variation on Fermat's Diophantine m-tuple: 1 + the product of any two distinct terms is not a square; this sequence, which we'll call sequence S, is produced by the following algorithm. At the start, S is initially empty. At stage n, starting at n = 1, the algorithm checks whether there exists a number m already in the sequence, such that mn+1 is a perfect square. If such a number m is found, then n is not added to the sequence; otherwise, n is added. Then n is incremented to n + 1, and we repeat the procedure. Proof by Clark R. Lyons: We prove by strong induction that n is in the sequence S if and only if n == 1 (mod 4) or n == 2 (mod 4). Suppose now that this holds for all k < n. In case 1, either n == 1 (mod 4) or n == 2 (mod 4), and we wish to show that n does indeed enter the sequence S. That is, we wish to show that there does not exist m < n, already in the sequence at this point such that mn+1 is a square. By the inductive hypothesis m == 1 (mod 4) or m == 2 (mod 4). This means that both m and n are one of 1, 2, 5, or 6 mod 8. Using a multiplication table mod 8, we see that this implies mn+1 is congruent to one of 2, 3, 5, 6, or 7 mod 8. But we also see that mod 8, a perfect square is congruent to 0, 1, or 4. Thus mn+1 is not a perfect square, so n is added to the sequence. In case 2, n == 0 (mod 4) or n == 3 (mod 4), and we wish to show that n is not added to the sequence. That is, we wish to show that there exists m < n already in the sequence such that mn+1 is a perfect square. For this we let m = n - 2, which is positive since n >= 3. By the inductive hypothesis, since m == 1 (mod 4) or m == 2 (mod 4) and m < n, m is already in the sequence. And we have m*n + 1 = (n - 2)*n + 1 = n^2 - 2*n + 1 = (n - 1)^2, so mn+1 is indeed a perfect square, and so n is not added to the sequence. Thus n is added to the sequence if and only if n == 1 (mod 4) or n == 2 (mod 4). This completes the proof. - Robert C. Lyons, Jun 30 2016
Also the number of maximal cliques in the (n + 1) X (n + 1) black bishop graph. - Eric W. Weisstein, Dec 01 2017
Lexicographically earliest sequence of distinct positive integers such that the average of any two or more consecutive terms is never an integer. (For opposite property see A005408.) - Ivan Neretin, Dec 21 2017
Numbers whose binary reflected Gray code (A014550) ends with 1. - Amiram Eldar, May 17 2021
Also: append its negated last bit to n-1. - M. F. Hasler, Oct 17 2022

Crossrefs

Cf. A153284 (first differences), A014848 (partial sums).
Cf. A014550, A046712 (subsequence).
Union of A016813 and A016825.

Programs

  • Haskell
    a042963 n = a042963_list !! (n-1)
    a042963_list = [x | x <- [0..], mod x 4 `elem` [1,2]]
    -- Reinhard Zumkeller, Feb 14 2012
  • Magma
    [ n : n in [1..165] | n mod 4 eq 1 or n mod 4 eq 2 ]; // Vincenzo Librandi, Jan 25 2011
    
  • Maple
    A046923:=n->(n mod 2) + 2n - 2; seq(A046923(n), n=1..100); # Wesley Ivan Hurt, Oct 10 2013
  • Mathematica
    Select[Range[109], Or[Mod[#, 4] == 1, Mod[#, 4] == 2] &] (* Ant King, Nov 17 2010 *)
    Table[(4 n - 3 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Dec 01 2017 *)
    LinearRecurrence[{1, 1, -1}, {1, 2, 5}, 20] (* Eric W. Weisstein, Dec 01 2017 *)
    CoefficientList[Series[(1 + x + 2 x^2)/((-1 + x)^2 (1 + x)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
  • PARI
    a(n)=2*n-1-(n-1)%2 \\ Jianing Song, Oct 06 2018; adapted to offset by Michel Marcus, Sep 09 2022
    
  • PARI
    apply( A042963(n)=n*2-2+n%2, [1..99]) \\ M. F. Hasler, Oct 17 2022
    

Formula

a(n) = 1 + A042948(n-1). [Corrected by Jianing Song, Oct 06 2018]
From Michael Somos, Jan 12 2000: (Start)
G.f.: x*(1 + x + 2*x^2)/((1 - x)^2*(1 + x)).
a(n) = a(n-1) + 2 + (-1)^n, a(0) = 1. (End) [This uses offset 0. - Jianing Song, Oct 06 2018]
A014493(n) = A000217(a(n)). - Reinhard Zumkeller, Oct 04 2004, Feb 14 2012
a(n) = Sum_{k=0..n} (A001045(k) mod 4). - Paul Barry, Mar 12 2004
A145768(a(n)) is odd. - Reinhard Zumkeller, Jun 05 2012
a(n) = A005843(n-1) + A059841(n-1). - Philippe Deléham, Mar 31 2009 [Corrected by Jianing Song, Oct 06 2018]
a(n) = 4*n - a(n-1) - 5 for n > 1. [Corrected by Jerzy R Borysowicz, Jun 09 2023]
From Ant King, Nov 17 2010: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) = (4*n - 3 - (-1)^n)/2. (End)
a(n) = (n mod 2) + 2*n - 2. - Wesley Ivan Hurt, Oct 10 2013
A163575(a(n)) = n - 1. - Reinhard Zumkeller, Jul 22 2014
E.g.f.: 2 + (2*x - 1)*sinh(x) + 2*(x - 1)*cosh(x). - Ilya Gutkovskiy, Jun 30 2016
E.g.f.: 2 + (2*x - 1)*exp(x) - cosh(x). - David Lovler, Jul 19 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 + log(2)/4. - Amiram Eldar, Dec 05 2021

Extensions

Offset corrected by Reinhard Zumkeller, Feb 14 2012
More terms by David Lovler, Jul 19 2022

A008545 Quadruple factorial numbers: Product_{k=0..n-1} (4*k + 3).

Original entry on oeis.org

1, 3, 21, 231, 3465, 65835, 1514205, 40883535, 1267389585, 44358635475, 1729986783525, 74389431691575, 3496303289504025, 178311467764705275, 9807130727058790125, 578620712896468617375, 36453104912477522894625, 2442358029135994033939875
Offset: 0

Views

Author

Joe Keane (jgk(AT)jgk.org)

Keywords

Comments

a(n-1), n >= 1, enumerates increasing plane (a.k.a. ordered) trees with n vertices (one of them a root labeled 1) with one version of a vertex with out-degree r = 0 (a leaf or a root) and each vertex with out-degree r >= 1 comes in binomial(r + 2, 2) types (like a binomial(r + 2, 2)-ary vertex). See the increasing tree comments under A001498. For example, a(1) = 3 from the three trees with n = 2 vertices (a root (out-degree r = 1, label 1) and a leaf (r = 0), label 2). There are three such trees because of the three types of out-degree r = 1 vertices. - Wolfdieter Lang, Oct 05 2007 [corrected by Karen A. Yeats, Jun 17 2013]
a(n) is the product of the positive integers less than or equal to 4n that have modulo 4 = 3. - Peter Luschny, Jun 23 2011

Examples

			G.f. = 1 + 3*x + 21*x^2 + 231*x^3 + 3465*x^4 + 65835*x^5 + 1514205*x^6 + ...
a(3) = sigma[4,3]^{3}_3 = 3*7*11 = 231. See the name. - _Wolfdieter Lang_, May 29 2017
		

Crossrefs

a(n)= A000369(n+1, 1) (first column of triangle).
Partial products of A004767.
Cf. A007696, A014601, A225471 (first column).

Programs

  • GAP
    List([0..20], n-> Product([0..n-1], k-> 4*k+3) ); # G. C. Greubel, Aug 18 2019
  • Haskell
    a008545 n = a008545_list !! n
    a008545_list = scanl (*) 1 a004767_list
    -- Reinhard Zumkeller, Oct 25 2013
    
  • Magma
    [1] cat [(&*[4*k+3: k in [0..n-1]]): n in [1..20]]; // G. C. Greubel, Aug 18 2019
    
  • Maple
    f := n->product( (4*k-1),k=0..n);
    A008545 := n -> mul(k, k = select(k-> k mod 4 = 3, [$1 .. 4*n])): seq(A008545(n), n=0..15); # Peter Luschny, Jun 23 2011
  • Mathematica
    FoldList[Times, 1, 4 Range[0, 20] + 3] (* Harvey P. Dale, Jan 19 2013 *)
    a[n_]:= Pochhammer[3/4, n] 4^n; (* Michael Somos, Jan 17 2014 *)
    a[n_]:= If[n < 0, 1 / Product[ -k, {k, 1, -4 n - 3, 4}], Product[k, {k, 3, 4 n - 1, 4}]]; (* Michael Somos, Jan 17 2014 *)
  • PARI
    a(n)=prod(k=0,n-1,4*k+3) \\ Charles R Greathouse IV, Jun 23 2011
    
  • PARI
    {a(n) = if( n<0, 1 / prod(k=1, -n, 3 - 4*k), prod(k=1, n, 4*k - 1))}; /* Michael Somos, Jan 17 2014 */
    
  • Sage
    [product(4*k+3 for k in (0..n-1)) for n in (0..20)] # G. C. Greubel, Aug 18 2019
    

Formula

a(n) = 3*A034176(n) = (4*n-1)(!^4), n >= 1, a(0) := 1.
E.g.f.: (1-4*x)^(-3/4).
a(n) ~ 2^(1/2)*Pi^(1/2)*Gamma(3/4)^(-1)*n^(1/4)*2^(2*n)*e^(-n)*n^n*{1 - 1/96*n^(-1) + ...}. - Joe Keane (jgk(AT)jgk.org), Nov 23 2001
G.f.: 1/(1 - 3x/(1 - 4x/(1 - 7x/(1 - 8x/(1 - 11x/(1 - 12x/(1 - 15x/(1 - 16x/(1 - 19x/(1 - 20x/(1 - 23x/(1 - 24x/(1 - ...))))))))))))) (continued fraction). - Paul Barry, Dec 03 2009
a(n) = (-1)^n*Sum_{k = 0..n} 4^k*s(n + 1, n + 1 - k), where s(n, k) are the Stirling numbers of the first kind, A048994. - Mircea Merca, May 03 2012
D-finite with recurrence: a(n) + (-4*n + 1)*a(n-1) = 0. - R. J. Mathar, Dec 04 2012
G.f.: 1/x - G(0)/(2*x), where G(k)= 1 + 1/(1 - x*(4*k-1)/(x*(4*k-1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 04 2013
a(-n) = (-1)^n / A007696(n). - Michael Somos, Jan 17 2014
G.f.: 1/(1 - b(1)*x / (1 - b(2)*x / ...)) where b = A014601. - Michael Somos, Jan 17 2014
a(n) = 4^n * Gamma(n+3/4) / Gamma(3/4). - Vaclav Kotesovec, Jan 28 2015
G.f.: 1/(1 - 3*x - 12*x^2/(1 - 11*x - 56*x^2/(1 - 19*x - 132*x^2/(1 - 27*x - 240*x^2/(1 - ...))))) (Jacobi continued fraction). - Nikolaos Pantelidis, Feb 28 2020
Sum_{n>=0} 1/a(n) = 1 + exp(1/4)*(Gamma(3/4) - Gamma(3/4, 1/4))/sqrt(2). - Amiram Eldar, Dec 18 2022

A079896 Discriminants of indefinite binary quadratic forms.

Original entry on oeis.org

5, 8, 12, 13, 17, 20, 21, 24, 28, 29, 32, 33, 37, 40, 41, 44, 45, 48, 52, 53, 56, 57, 60, 61, 65, 68, 69, 72, 73, 76, 77, 80, 84, 85, 88, 89, 92, 93, 96, 97, 101, 104, 105, 108, 109, 112, 113, 116, 117, 120, 124, 125, 128, 129, 132, 133, 136, 137, 140, 141, 145, 148
Offset: 1

Views

Author

Wolfdieter Lang, Jan 31 2003

Keywords

Comments

Numbers n such that n == 0 (mod 4) or n == 1 (mod 4), but n is not a square.
For an indefinite binary quadratic form over the integers a*x^2 + b*x*y + c*y^2 the discriminant is D = b^2 - 4*a*c > 0; and D not a square is assumed.
Also, a superset of A227453. - Ralf Stephan, Sep 22 2013
For the period length of the continued fraction of sqrt(a(n)) see A267857(n). - Wolfdieter Lang, Feb 18 2016
[I changed the offset to 1, since this is an important list. Many parts of the entry, including the b-file, will need to be changed. - N. J. A. Sloane, Mar 14 2023]

References

  • McMullen, Curtis. "Billiards and Teichmüller curves." Bulletin of the American Mathematical Society, 60:2 (2023), 195-250. See Table C.1.
  • A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, p. 112.

Crossrefs

Cf. A014601, A042948 (with squares), A087048 (class numbers), A267857.

Programs

  • Mathematica
    Select[ Range[148], (Mod[ #, 4] == 0 || Mod[ #, 4] == 1) && !IntegerQ[ Sqrt[ # ]] & ]
  • PARI
    seq(N) = {
      my(n = 1, v = vector(N), top = 0);
      while (top < N,
        if (n%4 < 2 && !issquare(n), v[top++] = n); n++;);
      return(v);
    };
    seq(62) \\ Gheorghe Coserea, Nov 07 2016

Formula

a(2*k^2 + 2*k + 1) = 4*(k+1)^2 + 1 for k >= 0. - Gheorghe Coserea, Nov 07 2016
a(2*k^2 + 4*k + 2 + (k+1)*(-1)^k) = (2*k + 3)*(2*k + 3 + (-1)^k) for k >= 0. - Bruno Berselli, Nov 10 2016

Extensions

More terms from Robert G. Wilson v, Mar 26 2003
Offset changed to 1 (since this is a list). - N. J. A. Sloane, Mar 14 2023

A191663 Dispersion of A042948 (numbers >3, congruent to 0 or 1 mod 4), by antidiagonals.

Original entry on oeis.org

1, 4, 2, 9, 5, 3, 20, 12, 8, 6, 41, 25, 17, 13, 7, 84, 52, 36, 28, 16, 10, 169, 105, 73, 57, 33, 21, 11, 340, 212, 148, 116, 68, 44, 24, 14, 681, 425, 297, 233, 137, 89, 49, 29, 15, 1364, 852, 596, 468, 276, 180, 100, 60, 32, 18, 2729, 1705, 1193, 937, 553
Offset: 1

Views

Author

Clark Kimberling, Jun 11 2011

Keywords

Comments

Row 1: A084639.
For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191663=dispersion of A042948 (0 or 1 mod 4 and >1)
A054582=dispersion of A005843 (0 or 2 mod 4 and >1; evens)
A191664=dispersion of A014601 (0 or 3 mod 4 and >1)
A191665=dispersion of A042963 (1 or 2 mod 4 and >1)
A191448=dispersion of A005408 (1 or 3 mod 4 and >1, odds)
A191666=dispersion of A042964 (2 or 3 mod 4)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191663 has 1st col A042964, all else A042948
A054582 has 1st col A005408, all else A005843
A191664 has 1st col A042963, all else A014601
A191665 has 1st col A014601, all else A042963
A191448 has 1st col A005843, all else A005408
A191666 has 1st col A042948, all else A042964
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.

Examples

			Northwest corner:
1...4...9....20...41
2...5...12...25...52
3...8...17...36...73
6...13..28...57...116
7...16..33...68...137
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 4; b = 5; m[n_] := If[Mod[n, 2] == 0, 1, 0];
    f[n_] := a*m[n + 1] + b*m[n] + 4*Floor[(n - 1)/2]
    Table[f[n], {n, 1, 30}]  (* A042948: (4+4k,5+4k) *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]]
    (* A191663 *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191663 *)

A156859 The main column of a version of the square spiral.

Original entry on oeis.org

0, 3, 7, 14, 22, 33, 45, 60, 76, 95, 115, 138, 162, 189, 217, 248, 280, 315, 351, 390, 430, 473, 517, 564, 612, 663, 715, 770, 826, 885, 945, 1008, 1072, 1139, 1207, 1278, 1350, 1425, 1501, 1580, 1660, 1743, 1827, 1914, 2002, 2093, 2185, 2280, 2376, 2475, 2575
Offset: 0

Views

Author

Emilio Apricena (emilioapricena(AT)yahoo.it), Feb 17 2009

Keywords

Comments

This spiral is sometimes called an Ulam spiral, but square spiral is a better name. - N. J. A. Sloane, Jul 27 2018
It is easy to see that the only two primes in the sequence are 3, 7. Therefore the primes of the version of Ulam spiral are divided into four parts (see also A035608): northeast (NE), northwest (NW), southwest (SW), and southeast (SE).
Number of pairs (x,y) having x and y of opposite parity with x in {0,...,n} and y in {0,...,2n}. - Clark Kimberling, Jul 02 2012
Partial Sums of A014601(n). - Wesley Ivan Hurt, Oct 11 2013

Crossrefs

Cf. A000290, A000384, A004526, A014601 (first differences), A115258.
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

Formula

a(n) = n^2 + n + floor((n+1)/2) = A002378(n) + A004526(n+1) = A002620(n+1) + 3*A002620(n).
From R. J. Mathar, Feb 20 2009: (Start)
G.f.: x*(3+x)/((1+x)*(1-x)^3).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). (End)
a(n-1) = floor(n/(e^(1/n)-1)). - Richard R. Forberg, Jun 19 2013
a(n) = A000290(n+1) + A004526(-n-1). - Wesley Ivan Hurt, Jul 15 2013
a(n) + a(n+1) = A014105(n+1). - R. J. Mathar, Jul 15 2013
a(n) = floor(A000384(n+1)/2). - Bruno Berselli, Nov 11 2013
E.g.f.: (x*(5 + 2*x)*cosh(x) + (1 + 5*x + 2*x^2)*sinh(x))/2. - Stefano Spezia, Apr 24 2024
Sum_{n>=1} 1/a(n) = 4/9 + 2*log(2) - Pi/3. - Amiram Eldar, Apr 26 2024

Extensions

More terms added by Wesley Ivan Hurt, Oct 11 2013
Showing 1-10 of 64 results. Next