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

A078147 First differences of sequence of nonsquarefree numbers, A013929.

Original entry on oeis.org

4, 1, 3, 4, 2, 2, 4, 1, 2, 1, 4, 4, 4, 4, 1, 3, 1, 1, 2, 2, 2, 4, 3, 1, 4, 4, 3, 1, 4, 1, 3, 4, 2, 2, 4, 2, 1, 1, 4, 4, 4, 4, 1, 3, 1, 3, 1, 1, 2, 4, 3, 1, 4, 4, 3, 1, 2, 2, 1, 3, 4, 2, 2, 4, 1, 2, 1, 3, 1, 4, 4, 4, 1, 3, 4, 2, 2, 4, 3, 1, 4, 4, 4, 4, 1, 3, 4, 2, 2, 4, 2, 1, 1, 1, 3, 2, 2, 4, 4, 1, 3, 4, 2, 2, 3
Offset: 1

Views

Author

Labos Elemer, Nov 26 2002

Keywords

Comments

Run lengths in A132345, apart from initial run of zeros. - Reinhard Zumkeller, Apr 22 2012
The asymptotic density of the occurrences of 1 in this sequence is density(A068781)/density(A013929) = (1 - 2 * A059956 + A065474)/A229099 = 0.272347... - Amiram Eldar, Mar 09 2021

Examples

			a(1) = 4 = 8 - 4.
		

Crossrefs

Programs

  • Haskell
    a078147 n = a078147_list !! (n-1)
    a078147_list = zipWith (-) (tail a013929_list) a013929_list
    -- Reinhard Zumkeller, Apr 22 2012
    
  • Mathematica
    t=Flatten[Position[Table[MoebiusMu[w], {w, 1, 1000}], 0]]; t1=Delete[RotateLeft[t]-t, -1]
    Differences[Select[Range[300],!SquareFreeQ[#]&]] (* Harvey P. Dale, May 07 2012 *)
  • PARI
    lista(nn) = {my(prec=0); for (n=1, nn, if (!issquarefree(n), if (prec, print1(n-prec, ", ")); prec = n;););} \\ Michel Marcus, Mar 26 2020
    
  • Python
    from math import isqrt
    from sympy import mobius, factorint
    def A078147(n):
        def f(x): return n+sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return next(i for i in range(1,5) if any(d>1 for d in factorint(m+i).values())) # Chai Wah Wu, Sep 10 2024

Formula

a(n) = A013929(n+1) - A013929(n).
a(n) = 1, 2, 3 or 4 since n = 4*k is always nonsquarefree.
Asymptotic mean: lim_{n->oo} (1/n) Sum_{k=1..n} a(k) = Pi^2/(Pi^2-6) = 2.550546... - Amiram Eldar, Oct 21 2020

Extensions

Offset fixed by Reinhard Zumkeller, Apr 22 2012

A132188 Number of 3-term geometric progressions with no term exceeding n.

Original entry on oeis.org

1, 2, 3, 6, 7, 8, 9, 12, 17, 18, 19, 22, 23, 24, 25, 32, 33, 38, 39, 42, 43, 44, 45, 48, 57, 58, 63, 66, 67, 68, 69, 76, 77, 78, 79, 90, 91, 92, 93, 96, 97, 98, 99, 102, 107, 108, 109, 116, 129, 138, 139, 142, 143, 148, 149, 152, 153, 154, 155, 158
Offset: 1

Views

Author

Gerry Myerson, Nov 21 2007

Keywords

Comments

a(n) = number of pairs (i,j) in [1..n] X [1..n] with integral geometric mean sqrt(i*j). Cf. A000982, A362931. - N. J. A. Sloane, Aug 28 2023
Also the number of 2 X 2 symmetric singular matrices with entries from {1, ..., n} - cf. A064368.
Rephrased: Number of ordered triples (w,x,y) with all terms in {1,...,n} and w^2=x*y. See A211422. - Clark Kimberling, Apr 14 2012

Examples

			a(4) counts these six (w,x,y) - triples: (1,1,1), (2,1,4), (2,4,1), (2,2,2), (3,3,3), (4,4,4). - _Clark Kimberling_, Apr 14 2012
		

Crossrefs

Programs

  • Haskell
    a132188 0 = 0
    a132188 n = a132345 n + (a120486 $ fromInteger n)
    -- Reinhard Zumkeller, Apr 21 2012
    
  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+
          1+2*add(`if`(issqr(i*n), 1, 0), i=1..n-1))
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Aug 28 2023
  • Mathematica
    t[n_] := t[n] = Flatten[Table[w^2 - x*y, {w, 1, n}, {x, 1, n}, {y, 1, n}]]
    c[n_] := Count[t[n], 0]
    t = Table[c[n], {n, 0, 80}]  (* Clark Kimberling, Apr 14 2012 *)
  • Python
    from sympy.ntheory.primetest import is_square
    def A132188(n): return n+(sum(1 for x in range(1,n+1) for y in range(1,x) if is_square(x*y))<<1) # Chai Wah Wu, Aug 28 2023

Formula

a(n) = Sum [sqrt(n/k)]^2, where the sum is over all squarefree k not exceeding n.
If we call A120486, this sequence and A132189 F(n), P(n) and S(n), respectively, then P(n) = 2 F(n) - n = S(n) + n. The Finch-Sebah paper cited at A000188 proves that F(n) is asymptotic to (3 / pi^2) n log n. In the reference, we prove that F(n) = (3 / pi^2) n log n + O(n), from which it follows that P(n) = (6 / pi^2) n log n + O(n) and similarly for S(n).
a(n) = Sum_{1 <=x,y <=n} A010052(x*y). - Clark Kimberling, Apr 14 2012
a(n) = n+2*Sum_{1<=xA010052(x*y). - Chai Wah Wu, Aug 28 2023

A057918 Number of pairs of numbers (r,s) each less than n such that (r,s,n) is in geometric progression.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Nov 22 2000

Keywords

Comments

Also, the number of integers k in {1,2,...,n-1} such that k*n is square. - John W. Layman, Sep 08 2011

Examples

			a(72)=5 since (2,12,72), (8,24,72), (18,36,72), (32,48,72), (50,60,72) are the possible three term geometric progressions.
		

Crossrefs

Cf. A132345 (partial sums).

Programs

  • Haskell
    a057918 n = sum $ map ((0 ^) . (`mod` n) . (^ 2)) [1..n-1]
    -- Reinhard Zumkeller, Mar 27 2012

Formula

a(n) = A000188(n) - 1.
a(A005117(n)) = 0; a(A013929(n)) > 0; A008966(n) = A000007(a(n)); a(A133466(n)) = 1; a(A195085(n)) = 2. - Reinhard Zumkeller, Mar 27 2012

A120486 Partial sums of A000188.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 8, 10, 13, 14, 15, 17, 18, 19, 20, 24, 25, 28, 29, 31, 32, 33, 34, 36, 41, 42, 45, 47, 48, 49, 50, 54, 55, 56, 57, 63, 64, 65, 66, 68, 69, 70, 71, 73, 76, 77, 78, 82, 89, 94, 95, 97, 98, 101, 102, 104, 105, 106, 107, 109, 110, 111, 114, 122, 123, 124, 125, 127, 128
Offset: 1

Views

Author

Gerry Myerson, Nov 21 2007

Keywords

Comments

This sequence can also be described as the number of 3-term nondecreasing geometric progressions with no term exceeding n.
a(n) = A132188(n) - A132345(n). - Reinhard Zumkeller, Apr 21 2012

Crossrefs

Programs

  • Haskell
    a120486 n = a120486_list !! (n - 1)
    a120486_list = scanl1 (+) a000188_list
    -- Reinhard Zumkeller, Apr 22 2012
  • Maple
    with(numtheory): seq(add(phi(k)*floor(n/k^2), k=1..floor(sqrt(n))), n=1..100); # Ridouane Oudra, Aug 18 2019

Formula

a(n) = 3n log(n) / Pi^2 + O(n). - Griffin N. Macris, Jan 28 2017
a(n) ~ 3*n*((log(n) + (3*gamma - 1))/ Pi^2 - 12*(Zeta'(2)/Pi^4)), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jan 30 2019
a(n) = Sum_{k=1..floor(sqrt(n))} phi(k)*floor(n/k^2), where phi is the Euler totient function A000010. - Ridouane Oudra, Aug 18 2019
G.f.: (1/(1 - x)) * Sum_{k>=1} phi(k) * x^(k^2) / (1 - x^(k^2)). - Ilya Gutkovskiy, Aug 26 2021
From Ridouane Oudra, Oct 05 2024: (Start)
a(n) = Sum_{i=1..n} Sum_{j=1..i} A010052(i*j).
a(n) = A132345(n) + n.
a(n) = (1/2)*A132189(n) + n.
a(n) = (1/2)*(A132188(n) + n). (End)

A132189 Number of non-constant 3-term geometric progressions with no term exceeding n.

Original entry on oeis.org

0, 0, 0, 2, 2, 2, 2, 4, 8, 8, 8, 10, 10, 10, 10, 16, 16, 20, 20, 22, 22, 22, 22, 24, 32, 32, 36, 38, 38, 38, 38, 44, 44, 44, 44, 54, 54, 54, 54, 56, 56, 56, 56, 58, 62, 62, 62, 68, 80, 88, 88, 90, 90, 94, 94, 96, 96, 96, 96, 98, 98, 98, 102, 116, 116, 116, 116, 118, 118, 118
Offset: 1

Views

Author

Gerry Myerson, Nov 21 2007

Keywords

Comments

In racetrack language, this is the number of trifectas in geometric progression in an n-horse race.
It appears that geometric progression like (k,0,0) are excluded. - Stefan Steinerberger, Nov 24 2007

Crossrefs

Cf. A132345.

Programs

  • Mathematica
    a = {}; For[n = 1, n < 80, n++, c = 0; For[j = 1, j < n + 1, j++, For[h = 1, h < n + 1, h++, If[Not[h == j], If[IntegerQ[j*(h/j)^2], If[j*(h/j)^2 < n + 1, c++ ]]]]]; AppendTo[a, c]]; a (* Stefan Steinerberger, Nov 24 2007 *)

Formula

a(n) = 2 * A132345(n). - Alois P. Heinz, Jun 08 2025

Extensions

More terms from Stefan Steinerberger, Nov 24 2007

A339026 Number of pairs (x,y): 1 <= x < y <= n*n, such that x*y is a square.

Original entry on oeis.org

0, 1, 4, 8, 16, 27, 40, 58, 80, 105, 128, 158, 198, 237, 278, 336, 382, 435, 502, 574, 632, 699, 798, 868, 968, 1063, 1176, 1262, 1362, 1505, 1590, 1732, 1880, 2007, 2150, 2272, 2434, 2567, 2746, 2930, 3062, 3265, 3444, 3654, 3832, 4035, 4284, 4454, 4668, 4875, 5142, 5364, 5590, 5889, 6078, 6336, 6614, 6881, 7166
Offset: 1

Views

Author

Edward Krogius, Nov 19 2020

Keywords

Examples

			For n = 3, we have the following solutions: (1,4), (1,9), (2,8), (4,9), therefore a(3) = 4.
For n = 4, we have the following solutions: (1,4), (1,9), (1,16), (2,8), (3,12), (4,9), (4,16), (9,16), therefore a(4) = 8.
		

Crossrefs

Programs

  • Mathematica
    Array[Sum[EulerPhi[j] Floor[(#^2)/(j^2)], {j, 2, #}] &, 59] (* Michael De Vlieger, Dec 11 2020 *)
  • PARI
    A339026(n) = sum(i=2,n,floor(n^2/i^2)*eulerphi(i)); \\ Antti Karttunen, Nov 23 2020

Formula

a(n) = Sum_{j=2..n} phi(j) * floor(n^2/j^2).
a(n) = (A338894(n) - n^2)/2.
a(n) = A132189(n^2)/2. - Antti Karttunen, Nov 23 2020

A365047 a(n) is the number of three-term geometric progressions, with rational ratio > 0, formed by the terms a(n-1), a(n-1-k) and a(n-1-2*k), where k >= 1 and n - 1 - 2*k >= 0.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Oct 21 2023

Keywords

Comments

The sequence is dominated by the count of three-term progressions consisting of three 0's. The 0 terms alternate between long runs on the even and odd n values, so the larger nonzero terms alternate between counting the progressions on these two subsequences, leading to two interrupted lines on the graph of the terms, along with the much lower counts of other three-term subsequences. See the attached image.

Examples

			a(3) = 1 and a(2) = a(1) = a(0) = 0 form a progression with ratio 1 separated by one term.
a(8) = 1 as a(7) = a(5) = a(3) = 1 for a progression with ratio 1 separated by two terms.
a(12) = 2 as a(11) = a(8) = a(5) = 1 form a progression with ratio 1 separated by three terms, while a(11) = a(7) = a(3) = 1 form a progression with ratio 1 separated by four terms.
a(20) = 2 as a(19) = 4, a(15) = 2, a(11) = 1 form a progression with ratio 1/2 separated by four terms, while a(19) = 4, a(12) = 2, a(5) = 1  form a progression with ratio 1/2 separated by seven terms.
a(170) = 1 as a(169) = 16, a(131) = 12, a(93) = 9 form a progression with ratio 3/4 separated by thirty-eight terms. This is the first series with a ratio that is not an integer or an integer reciprocal.
		

Crossrefs

A366472 Irregular triangle read by rows: T(n,k) (n >= 1, k >= 1) = number of increasing geometric progressions in {1,2,3,...,n} of length k with rational ratio.

Original entry on oeis.org

1, 2, 1, 3, 3, 4, 6, 1, 5, 10, 1, 6, 15, 1, 7, 21, 1, 8, 28, 2, 1, 9, 36, 4, 1, 10, 45, 4, 1, 11, 55, 4, 1, 12, 66, 5, 1, 13, 78, 5, 1, 14, 91, 5, 1, 15, 105, 5, 1, 16, 120, 8, 2, 1, 17, 136, 8, 2, 1, 18, 153, 10, 2, 1, 19, 171, 10, 2, 1, 20, 190, 11, 2, 1, 21, 210, 11, 2, 1, 22, 231, 11, 2, 1, 23, 253, 11, 2, 1, 24, 276, 12, 3, 1
Offset: 1

Views

Author

Keywords

Examples

			Triangle begins:
  [1],
  [2, 1],
  [3, 3],
  [4, 6, 1],
  [5, 10, 1],
  [6, 15, 1],
  [7, 21, 1],
  [8, 28, 2, 1],
  [9, 36, 4, 1],
  [10, 45, 4, 1],
  [11, 55, 4, 1],
  [12, 66, 5, 1],
  [13, 78, 5, 1],
  [14, 91, 5, 1],
  [15, 105, 5, 1],
  [16, 120, 8, 2, 1],
...
		

Crossrefs

Row sums give A366471.
First three columns are A000027, A000217, A132345.
Cf. A000010.

Programs

  • Maple
    with(numtheory);
    A366472 := proc(n) local v,u2,u1,k,i,p;
    v := Array(1..100, 0);
    v[1] := n;
    u1 := 1+floor(log(n)/log(2));
    for k from 2 to u1 do
       u2 := floor(n^(1/(k-1)));
       v[k] := add(phi(p)*floor(n/p^(k-1)),p=2..u2);
      od;
    [seq(v[i],i=1..u1)];
    end;
    for n from 1 to 36 do lprint(A366472(n)); od:

Formula

T(n,k) = Sum_{p=2..floor(n^(1/(k-1)))} phi(p)*floor(n/p^(k-1)) where phi is the Euler phi-function A000010 and k runs from 1 to 1+floor(log_2(n)).

A366907 a(n) is the number of geometric progressions with three or more terms, with rational ratio > 0, formed by the terms a(n-1), a(n-1-k), a(n-1-2*k),...,a(n-1-t*k) where k>=1, t>=2, and n-1-t*k>=0.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 2, 0, 4, 1, 0, 1, 0, 0, 2, 0, 3, 0, 3, 0, 6, 0, 7, 0, 9, 0, 13, 0, 12, 0, 15, 0, 21, 0, 20, 0, 22, 0, 30, 0, 30, 0, 31, 0, 38, 0, 39, 0, 43, 0, 47, 0, 46, 0, 53, 0, 61, 0, 57, 0, 59, 0, 69, 0, 72, 0, 72, 0, 78, 0, 79, 0, 84, 0, 91, 0, 90, 0, 96, 0, 103, 0, 98, 0, 105, 0, 116
Offset: 0

Views

Author

Scott R. Shannon, Oct 27 2023

Keywords

Comments

The sequence is dominated by the count of progressions consisting of three or more 0's. Very rarely the count of these zero-progressions forms a new progression of its own, which forms a short series of small terms and resets the subsequent count of the zero-progressions to a lower value. In the first 10^5 terms this only happens three times - at a(10) (which is not readily noticeable on the graph of the terms), a(644), and a(61434). See the attached images.

Examples

			a(3) = 1 and a(2) = a(1) = a(0) = 0 form a progression with ratio 1 separated by one term.
a(7) = 2 as a(6) = a(4) = a(2) = 0 form a three-term progression with ratio 1 separated by two terms, while a(6) = a(4) = a(2) = a(0) = 0 form a four-term progression with ratio 1 separated by two terms.
a(10) = 1 as a(9) = 4, a(7) = 2, a(5) = 1 form a three-term progression with ratio 1/2 separated by two terms.
		

Crossrefs

A280844 Number of 2 X 2 matrices with entries in {-n,..,0,..,n} with no entries repeated having permanent = trace^n.

Original entry on oeis.org

0, 0, 0, 4, 16, 20, 16, 36, 56, 60, 72, 76, 80, 100, 112, 100, 136, 124, 152, 172, 192, 196, 224, 196, 232, 236, 264, 252, 288, 276, 288, 308, 344, 332, 344, 332, 384, 388, 416, 404, 456, 428, 456, 444, 496, 468, 512, 468, 536, 556, 648
Offset: 0

Views

Author

Indranil Ghosh, Jan 09 2017

Keywords

Comments

a(n) is also equal to the number of 2 X 2 matrices with entries in {-n,..,0,..n} with no elements repeated having determinant = trace^n except a(4). For permanent = trace^n, a(4) = 16 but for determinant = trace^n, a(4) = 24.
a(n) mod 4 = 0.
All solutions have trace -1, 0, or 1. The number of solutions with trace 0 is 8 * A132345(n), and the number of solutions with trace -1 is equal to the number of solutions with trace 1 when n is even. - David Radcliffe, Jun 08 2025

Examples

			For n = 5, the possible matrices are [-3,-5,-1,2], [-3,-1,-5,2],
[-3,1,5,2], [-3,5,1,2], [-2,-4,-1,2], [-2,-1,-4,2], [-2,1,4,2], [-2,4,1,2], [-1,1,3,2], [-1,3,1,2], [2,-5,-1,-3], [2,-4,-1,-2],
[2,-1,-5,-3], [2,-1,-4,-2], [2,1,3,-1], [2,1,4,-2], [2,1,5,-3],
[2,3,1,-1], [2,4,1,-2] and [2,5,1,-3].
Here each of the matrices is defined as M = [a,b,c,d] where a = M[1][1], b = M[1][2], c = M[2][1], d = M[2][2]. There are 20 possibilities. So, for n = 5, a(n) = 20.
		

Crossrefs

Programs

  • Python
    def t(n):
        s=0
        for a in range(-n,n+1):
            for b in range(-n,n+1):
                if a!=b:
                    for c in range(-n,n+1):
                        if a!=c and b!=c:
                            for d in range(-n,n+1):
                                if d!=a and d!=b and d!=c:
                                    if (a*d+b*c)==(a+d)**n:
                                        s+=1
        return s
    for i in range(0,24):
        print(t(i), end=', ')
Showing 1-10 of 11 results. Next