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

A049691 a(n)=T(n,n), array T as in A049687. Also a(n)=T(2n,2n), array T given by A049639.

Original entry on oeis.org

0, 3, 5, 9, 13, 21, 25, 37, 45, 57, 65, 85, 93, 117, 129, 145, 161, 193, 205, 241, 257, 281, 301, 345, 361, 401, 425, 461, 485, 541, 557, 617, 649, 689, 721, 769, 793, 865, 901, 949, 981, 1061, 1085, 1169, 1209, 1257, 1301, 1393, 1425, 1509, 1549
Offset: 0

Views

Author

Keywords

Comments

a(n) is related to the sequence b(n) = |{(x, y): gcd(x, y) = 1, 1<=x, y<=n}| (A018805) as follows: a(n) = b(n - 1) + 2 (for n > 1). - Shawn Westmoreland (westmore(AT)math.utexas.edu), Jun 11 2003
Comment from N. J. A. Sloane, Sep 08 2019 (Start)
The above comment can be rephrased as saying that a(n) is the cardinality of the subsequence F(B(2n),n) of the Farey series F_{2n} that is extensively studied in Matveev (2017). See the definition on page 1.
For example, F(B(2),1), F(B(4),2), F(B(6),3), and F(B(8),4) are:
[0, 1/2, 1],
[0, 1/3, 1/2, 2/3, 1],
[0, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 1],
[0, 1/5, 1/4, 1/3, 2/5, 3/7, 1/2, 4/7, 3/5, 2/3, 3/4, 4/5, 1],
of cardinalities 3,5,9,13 respectively. See also A324796/A324797. (End)
a(n) is the number of visible points on an n X n square lattice when viewed from (0, 0), (0, n), (n, 0), or (n, n). - Torlach Rush, Nov 16 2020
Also number of elements in { c/d ; -d <= c <= d <= n }, i.e., distinct fractions with denominator not exceeding n and absolute value of numerator not exceeding the denominator. - M. F. Hasler, Mar 26 2023

References

  • A. O. Matveev, Farey Sequences, De Gruyter, 2017.

Crossrefs

A206297 is an essentially identical sequence.

Programs

  • Maple
    Farey := proc(n) sort(convert(`union`({0}, {seq(seq(m/k, m=1..k), k=1..n)}), list)) end: # A006842/A006843
    BF := proc(m) local a,i,h,k; global Farey; a:=[];
    for i in Farey(2*m) do h:=numer(i); k:=denom(i);
    if (h <= m) and (k-m <= h) then a:=[op(a),i]; fi; od: a; end;
    [seq(nops(BF(m),m=1..20)]; # this sequence - N. J. A. Sloane, Sep 08 2019
  • Mathematica
    a[0] = 0; a[n_] := 2 + Sum[Quotient[n, g]^2*MoebiusMu[g], {g, 1, n}]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Oct 07 2017, translated from PARI *)
  • PARI
    a(n) = if(n>0, 2, 0) + sum(g=1, n, (n\g)^2 * moebius(g)); \\ Andrew Howroyd, Sep 17 2017
    
  • PARI
    a(n) = if(n>0, 1, 0) + 2 * sum(k=1, n, eulerphi(k)); \\ Torlach Rush, Nov 24 2020
    
  • PARI
    a(n)=#Set(concat([[c/d|c<-[-d..d],d]|d<-[0..n]])) \\ For illustrative purpose only! - M. F. Hasler, Mar 26 2023
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A049691(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(A049691(k1)-2)
            j, k1 = j2, n//j2
        return n*(n-1)-c+j+2 # Chai Wah Wu, Aug 04 2024

Formula

a(n) = A206297(n+1) = 2 + A018805(n) for n > 0. - Andrew Howroyd, Sep 17 2017
a(n) = 1 + 2 * Sum{k=1..n} A000010(k), n > 0. - Torlach Rush, Nov 24 2020

Extensions

Terms a(41) and beyond from Andrew Howroyd, Sep 17 2017

A049688 a(n) = Sum_{i=0..n} T(i,n-i), array T as in A049687.

Original entry on oeis.org

0, 2, 5, 10, 17, 28, 41, 60, 83, 112, 145, 188, 235, 294, 359, 432, 513, 610, 713, 834, 963, 1104, 1255, 1428, 1609, 1810, 2023, 2254, 2497, 2768, 3047, 3356, 3681, 4026, 4387, 4772, 5169, 5602, 6053, 6528, 7019
Offset: 0

Views

Author

Keywords

Comments

A131967(a(n)+1) = 1, A131967(a(n)) = 2. - Birkas Gyorgy, Feb 19 2011
Number of triples {A, B, C} where 1 <= A <= B <= C <= n+1 and gcd(C-B, B-A) = 1. E.g., for n=2, we have the 5 triples {1, 1, 2}, {1, 2, 2}, {2, 2, 3}, {2, 3, 3}, and {1, 2, 3}. - Griffin N. Macris, May 21 2016

Crossrefs

Programs

  • Mathematica
    Table[Sum[Sum[EulerPhi[j], {j, i}] + 1, {i, n}], {n, 0, 30}] (* Birkas Gyorgy, Feb 19 2011 *)
    Table[n + Sum[ EulerPhi[ j], {i, n}, {j, i}], {n, 0, 30}] (* Robert G. Wilson v, Feb 12 2015 *)

Formula

a(n) ~ n^2*(3+n) / Pi^2. - Griffin N. Macris, May 21 2016

A049689 a(n)=Sum{((-1)^(i+1))*T(i,n-i): i=0,1,...,n}, array T as in A049687.

Original entry on oeis.org

0, 0, 1, 0, 3, 0, 5, 0, 9, 0, 13, 0, 17, 0, 23, 0, 31, 0, 37, 0, 45, 0, 55, 0, 63, 0, 75, 0, 87, 0, 95, 0, 111, 0, 127, 0, 139, 0, 157, 0, 173, 0
Offset: 0

Views

Author

Keywords

A049648 T(n,n+1), array T as in A049687 and T(2n,2n+2), array T given by A049639.

Original entry on oeis.org

1, 4, 7, 11, 17, 23, 31, 41, 51, 61, 75, 89, 105, 123, 137, 153, 177, 199, 223, 249, 269, 291, 323, 353, 381, 413, 443, 473, 513, 549, 587, 633, 669, 705, 745, 781, 829, 883, 925, 965, 1021, 1073, 1127, 1189, 1233, 1279, 1347, 1409, 1467, 1529, 1581, 1637
Offset: 0

Views

Author

Keywords

Extensions

More terms from Michael Somos

A049693 a(n) = T(n,n+2), array T as in A049687.

Original entry on oeis.org

1, 5, 8, 14, 18, 28, 34, 46, 54, 70, 78, 100, 110, 130, 144, 168, 182, 216, 230, 260, 278, 312, 330, 372, 392, 430, 454, 500, 520, 578, 602, 652, 684, 728, 756, 816, 846, 906, 940, 1004, 1032, 1114, 1146, 1212, 1254, 1324, 1362, 1450, 1486, 1560, 1604, 1688
Offset: 0

Views

Author

Keywords

Extensions

More terms from Sean A. Irvine, Aug 06 2021

A049694 a(n) = T(n,n+3), array T as in A049687.

Original entry on oeis.org

1, 6, 10, 15, 22, 31, 38, 49, 62, 73, 88, 105, 116, 137, 158, 173, 198, 223, 240, 269, 298, 319, 348, 383, 408, 441, 480, 507, 548, 593, 620, 667, 706, 739, 790, 833, 868, 921, 978, 1015, 1072, 1133, 1168, 1233, 1298, 1339, 1402, 1469, 1516, 1583, 1654, 1705
Offset: 0

Views

Author

Keywords

Extensions

More terms from Sean A. Irvine, Aug 06 2021

A049639 Array T read by diagonals; T(i,j) = number of lines passing through (i,j) and at least two other lattice points (h,k) satisfying 0<=h<=i, 0<=k<=j.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

It appears that T(n, k) = A049687(n/2, k/2).

Examples

			Antidiagonals (each starting on row 1):
  0.
  0, 0.
  1, 0, 1.
  1, 1, 1, 1.
  1, 1, 3, 1, 1.
  1, 1, 3, 3, 1, 1.
  1, 1, 4, 3, 4, 1, 1.
  ...
		

Crossrefs

Cf. A049687.

Programs

  • Mathematica
    a[0|1, 0|1] = 0; a[0|1, ] = a[, 0|1] = 1; a[i_, j_] := Module[{slopes, cnt}, slopes = Union @ Flatten @ Table[(k-j)/(h-i), {h, 0, i-1}, {k, 0, j - 1}]; cnt[slope_] := Count[Flatten[Table[{h, k}, {h, 0, i-1}, {k, 0, j - 1}], 1], {h_, k_} /; (k-j)/(h-i) == slope]; Count[cnt /@ slopes, c_ /; c >= 2] + 2]; Table[a[i-j, j], {i, 0, 12}, {j, 0, i}] // Flatten (* Jean-François Alcover, Apr 03 2017 *)

A099957 a(n) = Sum_{k=0..n-1} phi(2k+1).

Original entry on oeis.org

1, 3, 7, 13, 19, 29, 41, 49, 65, 83, 95, 117, 137, 155, 183, 213, 233, 257, 293, 317, 357, 399, 423, 469, 511, 543, 595, 635, 671, 729, 789, 825, 873, 939, 983, 1053, 1125, 1165, 1225, 1303, 1357, 1439, 1503, 1559, 1647, 1719, 1779, 1851, 1947
Offset: 1

Views

Author

Hugo Pfoertner, Nov 13 2004

Keywords

Comments

The n-th term is the number of notes of the (2n-1)-limit tonality diamond. This is a term from music theory and means the scale consisting of the rational numbers r, 1 <= r < 2, such that the odd part of both the numerator and the denominator of r, when reduced to lowest terms, is less than or equal to the fixed odd number 2n-1. - Gene Ward Smith, Mar 27 2006
(1/4)*Number of distinct angular positions under which an observer positioned at the center of a square of a square lattice can see the (2n) X (2n) points symmetrically surrounding his position.
(1/8)*number of distinct angular positions under which an observer positioned at a lattice point of a square lattice can see the (2n+1)X(2n+1) points symmetrically surrounding his position gives A002088.
(1/2)*number of distinct angular positions under which an observer positioned at the center of an edge of a square lattice can see the (2n)X(2n-1) points symmetrically surrounding his position gives A099958.

Crossrefs

Bisection of A274401.
Partial sums of A037225.

Programs

  • Mathematica
    Accumulate[EulerPhi[2*Range[0,50]+1]] (* Harvey P. Dale, Aug 20 2021 *)
  • PARI
    apply( {A099957(n)=sum(k=1,n, eulerphi(2*k-1))}, [1..55]) \\ M. F. Hasler, Apr 03 2023

Formula

a(n+1) - a(n) = phi(2n+1) (A037225).
a(n) = (8/Pi^2)*n^2 + O(n^(3/2+eps)) (Lemma 1 in Lv Chuan, 2004). - Amiram Eldar, Aug 02 2022, corrected by M. F. Hasler, Mar 26 2023
a(n) = A002088(2*n-1) - A049690(n-1). - Chai Wah Wu, Aug 04 2024

A049704 Array T read by antidiagonals; T(i,j)=number of nonnegative slopes of lines determined by two points in the triangular set {(x,y): 0<=x<=i, 0<=y<=j-j*x/i} of lattice points.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			The array begins:
0 1 1 1 1 1 1 1 1...
1 1 1 1 1 1 1 1 1...
1 1 2 2 3 3 4 4 5...
1 1 2 4 4 5 6 6 7...
1 1 3 4 6 6 8 9 11...
...
		

Crossrefs

Programs

  • Mathematica
    t[i_,j_] := If[i==0||j==0, 1-KroneckerDelta[i+j], 1+Length[Union[Divide@@#& /@ Select[-Subtract@@@Subsets[Flatten[Table[{x,y}, {x,0,i}, {y,0,j-j*x/i}], 1], {2}], And@@Positive/@#&]]]];
    (*Table[t[i,j], {i,0,10}, {j,0,10}]//TableForm*)
    Flatten@Table[t[j,i-j], {i,0,20}, {j,0,i}]
    (* Andrey Zabolotskiy, Jun 09 2017 *)

Extensions

Name corrected by Michel Marcus and Andrey Zabolotskiy, Jun 10 2017

A099958 (1/2)*number of distinct angular positions under which an observer positioned at the center of an edge of a square lattice can see the (2n)X(2n-1) points symmetrically surrounding his position.

Original entry on oeis.org

1, 5, 13, 23, 37, 55, 75, 95, 127, 157, 185, 227, 263, 305, 357, 403, 455, 511, 571, 631, 703, 769, 833, 923, 997, 1069, 1169, 1245, 1329, 1443, 1535, 1631, 1743, 1849, 1957, 2075, 2195, 2307, 2439, 2565, 2683, 2845, 2957, 3097, 3265, 3385
Offset: 1

Views

Author

Hugo Pfoertner, Nov 13 2004

Keywords

Crossrefs

See A099957 for further information. Cf. A049687, A049690, A190815.

Formula

This is a bisection of A049690, that is, a(n) = Sum[k=1..2n+1, phi(2k)]. - Ralf Stephan, Nov 13 2004.
Showing 1-10 of 16 results. Next