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

A243582 Integers of the form 8k+7 (A004771) that cannot be written as sum of four distinct squares.

Original entry on oeis.org

7, 15, 23, 31, 47, 55, 103
Offset: 1

Views

Author

Walter Kehowski, Jun 08 2014

Keywords

Examples

			a(6) = 55 since 55 == 7 (mod 8) and all its representations as a sum of squares have duplicates, namely, 55=1^2+1^2+2^2+7^2, 55=1^2+2^2+5^2+5^2, 55=1^2+3^2+3^2+6^2.
		

Crossrefs

A017149 Duplicate of A004771.

Original entry on oeis.org

7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127, 135, 143, 151, 159
Offset: 0

Views

Author

Keywords

A004767 a(n) = 4*n + 3.

Original entry on oeis.org

3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223
Offset: 0

Views

Author

Keywords

Comments

Apart from initial term(s), dimension of the space of weight 2n cusp forms for Gamma_0(12).
Binary expansion ends 11.
These the numbers for which zeta(2*x+1) needs just 2 terms to be evaluated. - Jorge Coveiro, Dec 16 2004 [This comment needs clarification]
a(n) is the smallest k such that for every r from 0 to 2n - 1 there exist j and i, k >= j > i > 2n - 1, such that j - i == r (mod (2n - 1)), with (k, (2n - 1)) = (j,(2n - 1)) = (i, (2n - 1)) = 1. - Amarnath Murthy, Sep 24 2003
Complement of A004773. - Reinhard Zumkeller, Aug 29 2005
Any (4n+3)-dimensional manifold endowed with a mixed 3-Sasakian structure is an Einstein space with Einstein constant lambda = 4n + 2 [Theorem 3, p. 10 of Ianus et al.]. - Jonathan Vos Post, Nov 24 2008
Solutions to the equation x^(2*x) = 3*x (mod 4*x). - Farideh Firoozbakht, May 02 2010
Subsequence of A022544. - Vincenzo Librandi, Nov 20 2010
First differences of A084849. - Reinhard Zumkeller, Apr 02 2011
Numbers n such that {1, 2, 3, ..., n} is a losing position in the game of Nim. - Franklin T. Adams-Watters, Jul 16 2011
Numbers n such that there are no primes p that satisfy the relationship p XOR n = p + n. - Brad Clardy, Jul 22 2012
The XOR of all numbers from 1 to a(n) is 0. - David W. Wilson, Apr 21 2013
A089911(4*a(n)) = 4. - Reinhard Zumkeller, Jul 05 2013
First differences of A014105. - Ivan N. Ianakiev, Sep 21 2013
All triangular numbers in the sequence are congruent to {3, 7} mod 8. - Ivan N. Ianakiev, Nov 12 2013
Apart from the initial term, length of minimal path on an n-dimensional cubic lattice (n > 1) of side length 2, until a self-avoiding walk gets stuck. Construct a path connecting all 2n points orthogonally adjacent from the center, ending at the center. Starting at any point adjacent to the center, there are 2 steps to reach each of the remaining 2n - 1 points, resulting in path length 4n - 2 with a final step connecting the center, for a total path length of 4n - 1, comprising 4n points. - Matthew Lehman, Dec 10 2013
a(n-1), n >= 1, appears as first column in the triangles A238476 and A239126 related to the Collatz problem. - Wolfdieter Lang, Mar 14 2014
For the Collatz Conjecture, we identify two types of odd numbers. This sequence contains all the ascenders: where (3*a(n) + 1) / 2 is odd and greater than a(n). See A016813 for the descenders. - Jaroslav Krizek, Jul 29 2016

Examples

			G.f. = 3 + 7*x + 11*x^2 + 15*x^3 + 19*x^4 + 23*x^5 + 27*x^6 + 31*x^7 + ...
		

References

  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 85.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999. See Theorem 8.1 on page 240.

Crossrefs

Cf. A017101 and A004771 (bisection: 3 and 7 mod 8).
Cf. A016838 (square).

Programs

Formula

G.f.: (3+x)/(1-x)^2. - Paul Barry, Feb 27 2003
a(n) = 2*a(n-1) - a(n-2) for n > 1, a(0) = 3, a(1) = 7. - Philippe Deléham, Nov 03 2008
a(n) = A017137(n)/2. - Reinhard Zumkeller, Jul 13 2010
a(n) = 8*n - a(n-1) + 2 for n > 0, a(0) = 3. - Vincenzo Librandi, Nov 20 2010
a(n) = A005408(A005408(n)). - Reinhard Zumkeller, Jun 27 2011
a(n) = 3 + A008586(n). - Omar E. Pol, Jul 27 2012
a(n) = A014105(n+1) - A014105(n). - Michel Marcus, Sep 21 2013
a(n) = A016813(n) + 2. - Jean-Bernard François, Sep 27 2013
a(n) = 4*n - 1, with offset 1. - Wesley Ivan Hurt, Mar 12 2014
From Ilya Gutkovskiy, Jul 29 2016: (Start)
E.g.f.: (3 + 4*x)*exp(x).
Sum_{n >= 0} (-1)^n/a(n) = (Pi + 2*log(sqrt(2) - 1))/(4*sqrt(2)) = A181049. (End)

A004215 Numbers that are the sum of 4 but no fewer nonzero squares.

Original entry on oeis.org

7, 15, 23, 28, 31, 39, 47, 55, 60, 63, 71, 79, 87, 92, 95, 103, 111, 112, 119, 124, 127, 135, 143, 151, 156, 159, 167, 175, 183, 188, 191, 199, 207, 215, 220, 223, 231, 239, 240, 247, 252, 255, 263, 271, 279, 284, 287, 295, 303, 311, 316, 319, 327, 335, 343
Offset: 1

Views

Author

Keywords

Comments

Lagrange's theorem tells us that each positive integer can be written as a sum of four squares.
If n is in the sequence and k is an odd positive integer then n^k is in the sequence because n^k is of the form 4^i(8j+7). - Farideh Firoozbakht, Nov 23 2006
Numbers whose cubes do not have a partition as a sum of 3 squares. a(n)^3 = A134738(n). - Artur Jasinski, Nov 07 2007
A002828(a(n)) = 4; A025427(a(n)) > 0. - Reinhard Zumkeller, Feb 26 2015
There are infinitely many adjacent pairs (for example, 128n + 111 and 128n + 112 for any n), but never a triple of consecutive integers. - Ivan Neretin, Aug 17 2017
These numbers are called "forbidden numbers" in crystallography: for a cubic crystal, no reflection with index hkl such that h^2 + k^2 + l^2 = a(n) appears in the crystal's diffraction pattern. - A. Timothy Royappa, Aug 11 2021

Examples

			15 is in the sequence because it is the sum of four squares, namely, 3^2 + 2^2 + 1^2 + 1^2, and it can't be expressed as the sum of fewer squares.
16 is not in the sequence, because, although it can be expressed as 2^2 + 2^2 + 2^2 + 2^2, it can also be expressed as 4^2.
		

References

  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 261.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 12.
  • E. Poznanski, 1901. Pierwiastki pierwotne liczb pierwszych. Warszawa, pp. 1-63.
  • W. Sierpiński, 1925. Teorja Liczb. pp. 1-410 (p. 125).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, entry 4181.

Crossrefs

Complement of A000378.
Cf. A000118 (ways to write n as sum of 4 squares), A025427.

Programs

  • Haskell
    a004215 n = a004215_list !! (n-1)
    a004215_list = filter ((== 4) . a002828) [1..]
    -- Reinhard Zumkeller, Feb 26 2015
    
  • Maple
    N:= 1000: # to get all terms <= N
    {seq(seq(4^i * (8*j + 7), j = 0 .. floor((N/4^i - 7)/8)), i = 0 .. floor(log[4](N)))}; # Robert Israel, Sep 02 2014
  • Mathematica
    Sort[Flatten[Table[4^i(8j + 7), {i, 0, 2}, {j, 0, 42}]]] (* Alonso del Arte, Jul 05 2005 *)
    Select[Range[120], Mod[ #/4^IntegerExponent[ #, 4], 8] == 7 &] (* Ant King, Oct 14 2010 *)
  • PARI
    isA004215(n)={ local(fouri,j) ; fouri=1 ; while( n >=7*fouri, if( n % fouri ==0, j= n/fouri -7 ; if( j % 8 ==0, return(1) ) ; ) ; fouri *= 4 ; ) ; return(0) ; } { for(n=1,400, if(isA004215(n), print1(n,",") ; ) ; ) ; } \\ R. J. Mathar, Nov 22 2006
    
  • PARI
    isA004215(n)= n\4^valuation(n,4)%8==7 \\ M. F. Hasler, Mar 18 2011
    
  • Python
    def valuation(n, b):
        v = 0
        while n > 1 and n%b == 0: n //= b; v += 1
        return v
    def ok(n): return n//4**valuation(n, 4)%8 == 7 # after M. F. Hasler
    print(list(filter(ok, range(344)))) # Michael S. Branicky, Jul 15 2021
    
  • Python
    from itertools import count, islice
    def A004215_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not (m:=(~n&n-1).bit_length())&1 and (n>>m)&7==7,count(max(startvalue,1)))
    A004215_list = list(islice(A004215_gen(),30)) # Chai Wah Wu, Jul 09 2022
    
  • Python
    def A004215(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x>>(i<<1))-7>>3)+1 for i in range(x.bit_length()>>1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = A055039(n)/2. - Ray Chandler, Jan 30 2009
Numbers of the form 4^i*(8*j+7), i >= 0, j >= 0. [A.-M. Legendre & C. F. Gauss]
Products of the form A000302(i)*A004771(j), i, j >= 0. - R. J. Mathar, Nov 29 2006
a(n) = 6*n + O(log(n)). - Charles R Greathouse IV, Dec 19 2013
Conjecture: The number of terms < 2^n is A023105(n) - 2. - Tilman Neumann, Sep 20 2020

Extensions

More terms from Arlin Anderson (starship1(AT)gmail.com)
Additional comments from Jud McCranie, Mar 19 2000

A007522 Primes of the form 8n+7, that is, primes congruent to -1 mod 8.

Original entry on oeis.org

7, 23, 31, 47, 71, 79, 103, 127, 151, 167, 191, 199, 223, 239, 263, 271, 311, 359, 367, 383, 431, 439, 463, 479, 487, 503, 599, 607, 631, 647, 719, 727, 743, 751, 823, 839, 863, 887, 911, 919, 967, 983, 991, 1031, 1039, 1063, 1087, 1103, 1151
Offset: 1

Views

Author

Keywords

Comments

Primes that are the sum of no fewer than four positive squares.
Discriminant is 32, class is 2. Binary quadratic forms ax^2 + bxy + cy^2 have discriminant d = b^2 - 4ac and gcd(a, b, c) = 1.
Primes p such that x^4 = 2 has just two solutions mod p. Subsequence of A040098. Solutions mod p are represented by integers from 0 to p - 1. For p > 2, i is a solution mod p of x^4 = 2 if and only if p - i is a solution mod p of x^4 = 2, so the sum of the two solutions is p. The solutions are given in A065907 and A065908. - Klaus Brockhaus, Nov 28 2001
As this is a subset of A001132, this is also a subset of the primes of form x^2 - 2y^2. And as this is also a subset of A038873, this is also a subset of the primes of form x^2 - 2y^2. - Tito Piezas III, Dec 28 2008
Subsequence of A141164. - Reinhard Zumkeller, Mar 26 2011
Also a subsequence of primes of the form x^2 + y^2 + z^2 + 1. - Arkadiusz Wesolowski, Apr 05 2012
Primes p such that p XOR 6 = p - 6. - Brad Clardy, Jul 22 2012

References

  • Z. I. Borevich and I. R. Shafarevich, Number Theory. Academic Press, NY, 1966.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. B. Zagier, Zetafunktionen und quadratische Körper, Springer, 1981.

Crossrefs

Subsequence of A004771.
Cf. A141174 (d = 32). A038872 (d = 5). A038873 (d = 8). A068228, A141123 (d = 12). A038883 (d = 13). A038889 (d = 17). A141111, A141112 (d = 65).

Programs

  • Haskell
    a007522 n = a007522_list !! (n-1)
    a007522_list = filter ((== 1) . a010051) a004771_list
    -- Reinhard Zumkeller, Jan 29 2013
    
  • Magma
    [p: p in PrimesUpTo(2000) | p mod 8 eq 7]; // Vincenzo Librandi, Jun 26 2014
  • Maple
    select(isprime, [seq(i,i=7..10000,8)]); # Robert Israel, Nov 22 2016
  • Mathematica
    Select[8Range[200] - 1, PrimeQ] (* Alonso del Arte, Nov 07 2016 *)
  • PARI
    (A007522(m) = local(p, s, x, z); forprime(p = 3, m, s = []; for(x = 0, p-1, if(x^4%p == 2%p, s = concat(s, [x]))); z = matsize(s)[2]; if(z == 2, print1(p, ", ")))); A007522(1400)  \\ Does not return a(m) but prints all terms <= m. - Edited to make it executable by M. F. Hasler, May 22 2025.
    
  • PARI
    A007522_upto(N, start=1)=select(p->p%8==7, primes([start, N]))
    #A7522=A007522_upto(10^5)
    A007522(n)={while(#A7522A007522_upto(N*3\2, N+1))); A7522[n]} \\ M. F. Hasler, May 22 2025
    

Formula

Equals A000040 INTERSECT A004215. - R. J. Mathar, Nov 22 2006
a(n) = 7 + A139487(n)*8, n >= 1. - Wolfdieter Lang, Feb 18 2015

A000378 Sums of three squares: numbers of the form x^2 + y^2 + z^2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83
Offset: 1

Views

Author

Keywords

Comments

An equivalent definition: numbers of the form x^2 + y^2 + z^2 with x,y,z >= 0.
Bourgain studies "the spatial distribution of the representation of a large integer as a sum of three squares, on the small and critical scale as well as their electrostatic energy. The main results announced give strong evidence to the thesis that the solutions behave randomly. This is in sharp contrast to what happens with sums of two or four or more square." Sums of two nonzero squares are A000404. - Jonathan Vos Post, Apr 03 2012
The multiplicities for a(n) (if 0 <= x <= y <= z) are given as A000164(a(n)), n >= 1. Compare with A005875(a(n)) for integer x, y and z, and order taken into account. - Wolfdieter Lang, Apr 08 2013
a(n)^k is a member of this sequence for any k > 1. - Boris Putievskiy, May 05 2013
The selection rule for the planes with Miller indices (hkl) to undergo X-ray diffraction in a simple cubic lattice is h^2+k^2+l^2 = N where N is a term of this sequence. See A004014 for f.c.c. lattice. - Mohammed Yaseen, Nov 06 2022

Examples

			a(1) = 0 = 0^2 + 0^2 + 0^2. A005875(0) = 1 = A000164(0).
a(9) = 9 = 0^2 + 0^2 + 3^2 =  1^2 +  2^2 + 2^2. A000164(9) = 2. A000164(9) = 30 = 2*3 + 8*3 (counting signs and order). - _Wolfdieter Lang_, Apr 08 2013
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 37.
  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section C20.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 311.

Crossrefs

Union of A000290, A000404 and A000408 (common elements).
Union of A000290, A000415 and A000419 (disjunct sets).
Complement of A004215.
Cf. A005875 (number of representations if x, y and z are integers).

Programs

  • Maple
    isA000378 := proc(n) # return true or false depending on n being in the list
        local x,y ;
        for x from 0 do
            if 3*x^2 > n then
                return false;
            end if;
            for y from x do
                if x^2+2*y^2 > n then
                    break;
                else
                    if issqr(n-x^2-y^2) then
                        return true;
                    end if;
                end if;
            end do:
        end do:
    end proc:
    A000378 := proc(n) # generate A000378(n)
        option remember;
        local a;
        if n = 1 then
            0;
        else
            for a from procname(n-1)+1 do
                if isA000378(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A000378(n),n=1..100) ; # R. J. Mathar, Sep 09 2015
  • Mathematica
    okQ[n_] := If[EvenQ[k = IntegerExponent[n, 2]], m = n/2^k; Mod[m, 8] != 7, True]; Select[Range[0, 100], okQ] (* Jean-François Alcover, Feb 08 2016, adapted from PARI *)
  • PARI
    isA000378(n)=my(k=valuation(n, 2)); if(k%2==0, n>>=k; n%8!=7, 1)
    
  • PARI
    list(lim)=my(v=List(),k,t); for(x=0,sqrtint(lim\=1), for(y=0, min(sqrtint(lim-x^2),x), k=x^2+y^2; for(z=0,min(sqrtint(lim-k), y), listput(v,k+z^2)))); Set(v) \\ Charles R Greathouse IV, Sep 14 2015
    
  • Python
    def valuation(n, b):
        v = 0
        while n > 1 and n%b == 0: n //= b; v += 1
        return v
    def ok(n): return n//4**valuation(n, 4)%8 != 7
    print(list(filter(ok, range(84)))) # Michael S. Branicky, Jul 15 2021
    
  • Python
    from itertools import count, islice
    def A000378_gen(): # generator of terms
        return filter(lambda n:n>>2*(bin(n)[:1:-1].index('1')//2) & 7 < 7, count(1))
    A000378_list = list(islice(A000378_gen(),30)) # Chai Wah Wu, Jun 27 2022
    
  • Python
    def A000378(n):
        def f(x): return n-1+sum(((x>>(i<<1))-7>>3)+1 for i in range(x.bit_length()>>1))
        m, k = n-1, f(n-1)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 14 2025

Formula

Legendre: a nonnegative integer is a sum of three squares iff it is not of the form 4^k m with m == 7 (mod 8).
n^(2k+1) is in the sequence iff n is in the sequence. - Ray Chandler, Feb 03 2009
Complement of A004215; complement of A000302(i)*A004771(j), i,j>=0. - Boris Putievskiy, May 05 2013
a(n) = 6n/5 + O(log n). - Charles R Greathouse IV, Mar 14 2014

Extensions

More terms from Ray Chandler, Sep 05 2004

A017101 a(n) = 8n + 3.

Original entry on oeis.org

3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 123, 131, 139, 147, 155, 163, 171, 179, 187, 195, 203, 211, 219, 227, 235, 243, 251, 259, 267, 275, 283, 291, 299, 307, 315, 323, 331, 339, 347, 355, 363, 371, 379, 387, 395, 403, 411, 419, 427
Offset: 0

Views

Author

Keywords

Comments

Apart from initial term(s), dimension of the space of weight 2n cusp forms for Gamma_0( 47 ).
Also numbers of the form x^2 + y^2 + z^2, where x,y,z are odd integers. - Alexander Adamchuk, Dec 01 2006
Conjecture: 2*a(n) is the half-period of oscillation of a Langton's ant colony that is n basic blocks in length. To construct such blocks use a pair of ants facing north at (x,y) and (x+1,y+2) (using Golly's coordinate system). Each successive block is placed 1 cell away from the previous one, i.e., the x coordinate shifts by 3, so we have (x+3k,y) and (x+3k+1,y+2). Also, because of the symmetry of the oscillation pattern, 4*a(n) is the length of the whole period (see MathOverflow link for details). - Mikhail Kurkov, Nov 20 2019

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 247.

Crossrefs

Programs

Formula

a(n) = A001969(2*n+1) + A001969(2*n) = A000069(2*n+1) + A000069(2*n). - Philippe Deléham, Feb 04 2004
G.f.: (3+5*x)/(1-x)^2. - R. J. Mathar, Mar 30 2011
a(n) = 2*a(n-1) - a(n-2) for n>1. - Vincenzo Librandi, May 28 2011
a(A002265(n)) = A004442(n) + A004443(n). - Wesley Ivan Hurt, Apr 06 2016
E.g.f.: exp(x)*(3 + 8*x). - Stefano Spezia, Nov 20 2019
a(n) = A004767(2*n), for n >= 0. See also A004767(2*n+1) = A004771(n). - Wolfdieter Lang, Feb 03 2022

A047524 Numbers that are congruent to {2, 7} mod 8.

Original entry on oeis.org

2, 7, 10, 15, 18, 23, 26, 31, 34, 39, 42, 47, 50, 55, 58, 63, 66, 71, 74, 79, 82, 87, 90, 95, 98, 103, 106, 111, 114, 119, 122, 127, 130, 135, 138, 143, 146, 151, 154, 159, 162, 167, 170, 175, 178, 183, 186, 191, 194, 199, 202, 207, 210, 215, 218, 223, 226, 231, 234
Offset: 1

Views

Author

Keywords

Comments

A195605 is a subsequence. - Bruno Berselli, Sep 21 2011

Crossrefs

Programs

  • GAP
    Filtered([0..250],n->n mod 8=2 or n mod 8=7); # Muniru A Asiru, Aug 06 2018
    
  • Maple
    seq(coeff(series(x*(2+5*x+x^2)/((1+x)*(1-x)^2), x,n+1),x,n),n=1..60); # Muniru A Asiru, Aug 06 2018
  • Mathematica
    Select[Range[300],MemberQ[{2,7},Mod[#,8]]&] (* or *)
    LinearRecurrence[ {1,1,-1},{2,7,10},60] (* Harvey P. Dale, Nov 05 2017 *)
    CoefficientList[ Series[(x^2 + 5x + 2)/((x - 1)^2 (x + 1)), {x, 0, 60}], x] (* Robert G. Wilson v, Aug 07 2018 *)
  • Maxima
    makelist(4*n - mod(n,2) - 1, n, 1, 100); /* Franck Maminirina Ramaharo, Aug 06 2018 */
    
  • PARI
    is(n) = #setintersect([n%8], [2, 7]) > 0 \\ Felix Fröhlich, Aug 06 2018
    
  • Python
    def A047524(n): return (n<<2)-1-(n&1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = 8*n - a(n-1) - 7, n > 1. - Vincenzo Librandi, Aug 06 2010
From R. J. Mathar, Mar 22 2011: (Start)
a(n) = 4*n - 3/2 + (-1)^n/2.
G.f.: x*(2+5*x+x^2) / ( (1+x)*(x-1)^2 ). (End)
From Franck Maminirina Ramaharo, Aug 06 2018: (Start)
a(n) = 4*n - (n mod 2) - 1.
a(n) = A047615(n) + 2.
a(2*n) = A004771(n-1).
a(2*n-1) = A017089(n-1).
E.g.f.: ((8*x - 3)*exp(x) + exp(-x) + 2)/2. (End)
a(n) = a(n-1) + a(n-2) - a(n-3). - Muniru A Asiru, Aug 06 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+2)*Pi/16 - log(2)/8 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A047535 Numbers that are congruent to {4, 7} mod 8.

Original entry on oeis.org

4, 7, 12, 15, 20, 23, 28, 31, 36, 39, 44, 47, 52, 55, 60, 63, 68, 71, 76, 79, 84, 87, 92, 95, 100, 103, 108, 111, 116, 119, 124, 127, 132, 135, 140, 143, 148, 151, 156, 159, 164, 167, 172, 175, 180, 183, 188, 191, 196, 199, 204, 207, 212, 215, 220, 223, 228, 231
Offset: 1

Views

Author

Keywords

Comments

Union of A004771 and A017113.

Crossrefs

Programs

Formula

a(n) = 8*n - a(n-1) - 5 (with a(1)=4). - Vincenzo Librandi, Aug 06 2010
a(n) = 4*n -(1 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
G.f.: x*(4+3*x+x^2) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Jul 10 2015
From Franck Maminirina Ramaharo, Jul 22 2018: (Start)
a(n) = A047470(n) + 4.
E.g.f.: (2 - exp(-x) + (8*x - 1)*exp(x))/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+1)*Pi/16 - log(2)/4 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

A341520 Square array A(n,k) = A156552(A005940(1+n)*A005940(1+k)), read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 3, 5, 5, 3, 4, 7, 6, 7, 4, 5, 9, 11, 11, 9, 5, 6, 11, 10, 15, 10, 11, 6, 7, 13, 13, 19, 19, 13, 13, 7, 8, 15, 14, 23, 12, 23, 14, 15, 8, 9, 17, 23, 27, 21, 21, 27, 23, 17, 9, 10, 19, 18, 31, 22, 27, 22, 31, 18, 19, 10, 11, 21, 21, 35, 39, 29, 29, 39, 35, 21, 21, 11, 12, 23, 22, 39, 20, 47, 30, 47, 20, 39, 22, 23, 12
Offset: 0

Views

Author

Antti Karttunen, Feb 13 2021

Keywords

Comments

The indices run as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), etc. The array is symmetric.
This array defines a binary operation on the nonnegative integers that matches up the zeros in the binary representation of each operand (starting from the right, and including as many leading zeros as necessary) and concatenates the two (possibly null) strings of ones to the right of each matched pair of zeros. See the examples. - Peter Munn, Feb 14 2021.
As such it could be useful for implementing multiplication, say, in Turing machines, with a "tape-like" unary-binary encoding of the prime factorization of n (A156552). However, such representation is not very useful if addition or subtraction is also needed.

Examples

			The top left {0..15} X {0..16} corner of the array:
   0,  1,  2,  3,  4,  5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
   1,  3,  5,  7,  9, 11,  13,  15,  17,  19,  21,  23,  25,  27,  29,  31,
   2,  5,  6, 11, 10, 13,  14,  23,  18,  21,  22,  27,  26,  29,  30,  47,
   3,  7, 11, 15, 19, 23,  27,  31,  35,  39,  43,  47,  51,  55,  59,  63,
   4,  9, 10, 19, 12, 21,  22,  39,  20,  25,  26,  43,  28,  45,  46,  79,
   5, 11, 13, 23, 21, 27,  29,  47,  37,  43,  45,  55,  53,  59,  61,  95,
   6, 13, 14, 27, 22, 29,  30,  55,  38,  45,  46,  59,  54,  61,  62, 111,
   7, 15, 23, 31, 39, 47,  55,  63,  71,  79,  87,  95, 103, 111, 119, 127,
   8, 17, 18, 35, 20, 37,  38,  71,  24,  41,  42,  75,  44,  77,  78, 143,
   9, 19, 21, 39, 25, 43,  45,  79,  41,  51,  53,  87,  57,  91,  93, 159,
  10, 21, 22, 43, 26, 45,  46,  87,  42,  53,  54,  91,  58,  93,  94, 175,
  11, 23, 27, 47, 43, 55,  59,  95,  75,  87,  91, 111, 107, 119, 123, 191,
  12, 25, 26, 51, 28, 53,  54, 103,  44,  57,  58, 107,  60, 109, 110, 207,
  13, 27, 29, 55, 45, 59,  61, 111,  77,  91,  93, 119, 109, 123, 125, 223,
  14, 29, 30, 59, 46, 61,  62, 119,  78,  93,  94, 123, 110, 125, 126, 239,
  15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255,
  16, 33, 34, 67, 36, 69,  70, 135,  40,  73,  74, 139,  76, 141, 142, 271,
...
From _Peter Munn_, Feb 24 2021: (Start)
We consider the case of n = 10, k = 41, following the procedure in the Feb 14 2021 comment.
First, write 10 and 41 in binary:
  10 = 1010_2
  41 = 101001_2
Add at least one leading zero to each number, equalizing number of zeros:
  0  0  1  0  1  0
  0  1  0  1  0  0  1
Align zeros, but separate ones:
  0     0  1     0  1  0
  |     |        |     |
  0  1  0     1  0     0  1
---------------------------
  0  1  0  1  1  0  1  0  1
Concatenating the ones, as shown above, we get 10110101_2 = 181.
So A(10, 41) = 181.
(End)
		

Crossrefs

Cf. A088698 (main diagonal).
Rows/columns 0-3: A001477, A005408, A341522, A004767. Row/column 7: A004771.
Cf. A341521 (the lower triangular section).

Programs

  • Mathematica
    Block[{nn = 12, a = {1}}, Do[AppendTo[a, If[EvenQ[i], Times @@ Map[Prime[PrimePi[#1] + 1]^#2 & @@ # &, FactorInteger[#]] &@ a[[(i/2) + 1]], 2 a[[((i - 1)/2) + 1]]]], {i, nn}]; Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ #]] &[a[[1 + n - k]]*a[[1 + k]] ], {n, 0, nn}, {k, n, 0, -1}]] // Flatten (* Michael De Vlieger, Feb 24 2021 *)
  • PARI
    up_to = 105;
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A341520sq(n,k) = A156552(A005940(1+n)*A005940(1+k));
    A341520list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A341520sq(col,(a-(col))))); (v); };
    v341520 = A341520list(up_to);
    A341520(n) = v341520[1+n];

Formula

A(x, y) = A156552(A005940(1+x) * A005940(1+y)).
For all n>=0, A(0, n) = A(n, 0) = n.
For all x>=0, y>=0, A(x, y) = A(y, x).
For all x, y, z >= 0, A(x, A(y, z)) = A(A(x, y), z).
From Antti Karttunen, Feb 27 2022: (Start)
For all x, y >= 0, A(x, y) = A(A351961(x,y), A351962(x,y)).
For x >= 0, y > 0, A(x, y) = A351960(x, A(x, A297164(y))).
(End)
Showing 1-10 of 44 results. Next