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 11-20 of 20 results.

A066284 a(n) = A066135(4*n).

Original entry on oeis.org

34, 84, 34, 84, 34, 194, 34, 84, 34, 84, 34, 228, 34, 84, 34, 84, 34, 194, 34, 84, 34, 84, 34, 228, 34, 84, 34, 84, 34, 194, 34, 84, 34, 84, 34, 386, 34, 84, 34, 84, 34, 194, 34, 84, 34, 84, 34, 228, 34, 84, 34, 84, 34, 194, 34, 84, 34, 84, 34, 228, 34, 84, 34, 84, 34, 194
Offset: 1

Views

Author

Labos Elemer, Dec 11 2001

Keywords

Comments

a(n) <= 2p, where p = A002586(4n) is the least prime factor of (1 + 16^n). (See the Comment in A066135.) - Jonathan Sondow, Nov 23 2012

Examples

			First 3 terms correspond to entries of other sequences as follows: a(1)=A046763(2), a(2)=A055712(2), a(3)=A055716(2).
From _Michael De Vlieger_, Jul 17 2017: (Start)
First position of values, with observations pertaining to values for 1 <= n <= 3000:
    Value   Position   Observations:
    --------------------------------
       34     1        All odd.
       84     2        In A047235.
      194     6        In A017593.
      228    12
      386    36
     1282    72
     1538   144
     3084   288
   147468   576
     1956   864
  1046532  1152
    24578  2304
     3252  2880
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[m = 2; While[Mod[DivisorSigma[4 n, m], m] > 0, m++]; m, {n, 66}] (* Michael De Vlieger, Jul 17 2017 *)
  • PARI
    a(n) = {n *= 4; my(m = 2); while (sigma(m, n) % m, m++); m;} \\ Michel Marcus, Oct 02 2016

Formula

a(n) = Min{x : sigma_4n(x) mod x = 0, x > 1}

A337923 a(n) is the exponent of the highest power of 2 dividing the n-th Fibonacci number.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Jan 29 2021

Keywords

Examples

			a(1) = 0 since Fibonacci(1) = 1 is odd.
a(6) = 3 since Fibonacci(6) = 8 = 2^3.
a(12) = 4 since Fibonacci(12) = 144 = 2^4 * 3^2.
		

Crossrefs

Cf. A090740 (sequence without zeros).

Programs

  • Mathematica
    a[n_] := IntegerExponent[Fibonacci[n], 2]; Array[a, 100]
  • Python
    def A337923(n): return int(not n%3)+(int(not n%6)<<1) if n%12 else 2+(~n&n-1).bit_length() # Chai Wah Wu, Jul 10 2022

Formula

a(n) = A007814(A000045(n)).
The following 4 formulas completely specify the sequence (Lengyel, 1995):
1. a(n) = 0 if n == 1 (mod 3) or n == 2 (mod 3).
2. a(n) = 1 if n == 3 (mod 6).
3. a(n) = 3 if n == 6 (mod 12).
4. a(n) = A007814(n) + 2 if n == 0 (mod 12).
a(A001651(n)) = 0.
a(A016945(n)) = 1.
a(A017593(n)) = 3.
a(A073762(n)) = 4.
The image of this function is A184985, i.e., all the nonnegative integers excluding 2.
Asymptotic mean: lim_{n->oo} (1/n) * Sum_{k=1..n} a(k) = 5/6.
a(3*n) = A090740(n), a(3*n+1) = a(3*n+2) = 0. - Joerg Arndt, Mar 01 2023

A337940 Triangle read by rows: T(n, k) = T(n+2) - T(n-k), with the triangular numbers T = A000217, for n >= 1, k = 1, 2, ..., n.

Original entry on oeis.org

6, 9, 10, 12, 14, 15, 15, 18, 20, 21, 18, 22, 25, 27, 28, 21, 26, 30, 33, 35, 36, 24, 30, 35, 39, 42, 44, 45, 27, 34, 40, 45, 49, 52, 54, 55, 30, 38, 45, 51, 56, 60, 63, 65, 66, 33, 42, 50, 57, 63, 68, 72, 75, 77, 78, 36, 46, 55, 63, 70, 76, 81, 85, 88, 90, 91
Offset: 1

Views

Author

Wolfdieter Lang, Nov 23 2020

Keywords

Comments

This number triangle results from the array A(n, m) = T(n+m+1) - T(n-1), with T = A000217, for n, m >= 1. For this array see the example by Bob Selcoe, in A111774 (but with rows continued). The present triangle is obtained by reading the array by upwards antidiagonals: T(n, k) = A(n+1-k, k). See also the Jul 09 2019 comment by Ralf Steiner with the formula c_k(n) (rows k >= 1, columns n >= 3), rewritten for A(n, m) = (m+2)*(2*n+m+1)/2, leading to T(n, k) = (k+2)*(2*n-k+3)/2.
Therefore this triangle is related to the problem of giving the numbers which are sums of at least three consecutive positive integers given as sequence A111774. It allows us to find the multiplicities for the numbers of A111774. They are given in A338428(n).
To obtain the multiplicity for number N (>= 6) from A111774 one has to consider only the triangle rows n = 1, 2, ..., floor((N-3)/3).
The row reversed triangle, considered by Bob Selcoe in A111774, is T(n, n-k+1) = T(n+2) - T(k-1), for n >= 1, and k=1, 2, ..., n.
This triangle contains no odd prime numbers and no exact powers 2^m, for m >= 0. This can be seen by considering the diagonal sequences D(d, k), for d >= 1, k >= 1 or the row sequences of the array A(n, m), for n >= 1 and m >= 1. The result is A(r+1, s-2) = s*(s + 2*r + 1)/2, for r >= 0 and s >= 3 (from the g.f. of the diagonals of T given below). This is also given in the Jul 09 2019 comment by Ralf Steiner in A111774. Therefore A(r+1, s-2) is a product of two numbers >= 2, hence not a prime. And in both cases (i) s/2 integer or (ii) (s + 2*r + 1)/2 integer not both numbers can be powers of 2 by simple parity arguments.
The previous comment means that each T(n, k) has at least one odd prime as a proper divisor.
A number N appears in this triangle, or in A111774, if and only if floor(N/2) - delta(N) >= 1, where delta(N) = A055034(N). For the sequence b(n) := floor(n/2) - delta(n), for n >= 2, see A219839(n), b(1) = -1. See a W. Lang comment in A111774 for the proof.

Examples

			The triangle T(n, k) begins:
n \ k  1  2  3  4  5   6   7   8   9  10  11  12  13  14  15 ...
1:     6
2:     9 10
3:    12 14 15
4:    15 18 20 21
5:    18 22 25 27 28
6:    21 26 30 33 35  36
7:    24 30 35 39 42  44  45
8:    27 34 40 45 49  52  54  55
9:    30 38 45 51 56  60  63  65  66
10:   33 42 50 57 63  68  72  75  77  78
11:   36 46 55 63 70  76  81  85  88  90  91
12:   39 50 60 69 77  84  90  95  99 102 104 105
13:   42 54 65 75 84  92  99 105 110 114 117 119 120
14:   45 58 70 81 91 100 108 115 121 126 130 133 135 136
15:   48 62 75 87 98 108 117 125 132 138 143 147 150 152 153
...
N = 15 appears precisely twice from the sums 4+5+6 = A(4, 1) = T(4, 1), and (1+2+3)+4+5 = A(1, 3) = T(3, 3), i.e., with a sum of 3 and 5 consecutive positive integers.
N = 42 appears three times from the sums 13+14+15 = A(13, 1) = T(13, 1), 9+10+11 +12 = A(9, 2) = T(10, 2), 3+4+5+6+7+8+9 = A(3, 5) = T(7, 5); i.e., 42 can be written as a sum of 3, 4 and 7 consecutive positive integers.
		

Crossrefs

Cf. A055034, A111774, A338428 (multiplicities), A219839.
For columns k = 1, 2, ..., 10 see A008585, A016825, A008587, A016945, A008589, A017113, A008591, A017329, A008593, A017593.
For diagonals d = 1, 2, ..., 10 see A000217, A000096, A055998, A055999, A056000, A056115, A056119 , A056121, A056126, A051942.

Programs

  • Mathematica
    Flatten[Table[((n+2)*(n+3)-(n-k)*(n-k+1))/2,{n,11},{k,n}]] (* Stefano Spezia, Nov 24 2020 *)

Formula

T(n, k) = ((n+2)*(n+3) - (n-k)*(n-k+1))/2, for n >= 1 and k = 1, 2, ..., n (see the name).
T(n, k) = (k+2)*(2*n-k+3)/2 (factorized).
G.f. columns k = 2*j+1, for j >= 0: Go(j, x) = x^(2*j+1)*(2*j+3)*(j+2 - (j+1)*x)/(1-x)^2,
G.f. columns k = 2*j, for j >= 1: Ge(j, x) = x^(2*j)*(j+1)*(2*j+3 - (2*j+1)*x)/(1-x)^2.
G.f. row polynomials: G(z,x) = z*x*(1 + z*x)^3*{3*(2-z) - (8-3*z)*(z*x) + (3-z)*(z*x)^2}/((1 - z)^2*(1 - (z*x)^2)^3).
G.f. diagonals d >= 1: GD(d, x) = ((d+1)*3 - (5*d+3)*x + (2*d+1)*x^2)/(1-x)^3.
G.f. of GD(d, x): GGD(z,x) = (6-8*x+3*x^2 - (3-3*x+x^2)*z)/((1-x)^3*(1-z)^2).

A140777 a(n) = 2*prime(n) - 4.

Original entry on oeis.org

0, 2, 6, 10, 18, 22, 30, 34, 42, 54, 58, 70, 78, 82, 90, 102, 114, 118, 130, 138, 142, 154, 162, 174, 190, 198, 202, 210, 214, 222, 250, 258, 270, 274, 294, 298, 310, 322, 330, 342, 354, 358, 378, 382, 390, 394, 418, 442, 450, 454, 462, 474, 478, 498, 510, 522
Offset: 1

Views

Author

Leroy Quet, May 29 2008, May 31 2008

Keywords

Comments

A number n is included if (p + n/p) is prime, where p is the smallest prime that divides n. Since all terms of this sequence are even (or otherwise p + n/p would be even and not a prime), p is always 2. So this sequence is the set of all even numbers n where (2 + n/2) is prime.
The entries are also encountered via the bilinear transform approximation to the natural log (unit circle). Specifically, evaluating 2(x-1)/(x+1) at x = 2, 3, 4, ..., the terms of this sequence are seen ahead of each new prime encountered. Additionally, the position of those same primes will occur at the entry positions. For clarity, the evaluation output is 2, 3, 1, 1, 6, 5, 4, 3, 10, 7, 3, 2, 14, 9, 8, 5, 18, 11, ..., where the entries ahead of each new prime are 2, 6, 10, 18, ... . As an aside, the same mechanism links this sequence to A165355. - Bill McEachen, Jan 08 2015
As a follow-up to previous comment, it appears that the numerators and denominators of 2(x-1)/(x+1) are respectively given by A145979 and A060819, but with different offsets. - Michel Marcus, Jan 14 2015
Subset of the union of A017641 & A017593. - Michel Marcus, Sep 01 2020

Examples

			The smallest prime dividing 42 is 2. Since 2 + 42/2 = 23 is prime, 42 is included in this sequence.
		

Crossrefs

Programs

  • Magma
    [2*NthPrime(n)-4: n in [1..80]]; // Vincenzo Librandi, Feb 19 2015
  • Maple
    A020639 := proc(n) local dvs,p ; dvs := sort(convert(numtheory[divisors](n),list)) ; for p in dvs do if isprime(p) then RETURN(p) ; fi ; od: error("%d",n) ; end: A111234 := proc(n) local p ; p := A020639(n) ; p+n/p ; end: isA140777 := proc(n) RETURN(isprime(A111234(n))) ; end: for n from 2 to 1200 do if isA140777(n) then printf("%d,",n) ; fi ; od: # R. J. Mathar, May 31 2008
    seq(2*ithprime(i)-4, i=1..1000); # Robert Israel, Jan 09 2015
  • Mathematica
    fQ[n_] := Block[{p = First@ First@ Transpose@ FactorInteger@ n}, PrimeQ[p + n/p] == True]; Select[ Range[2, 533], fQ@# &] (* Robert G. Wilson v, May 30 2008 *)
    Table[2 Prime[n] - 4, {n, 60}] (* Vincenzo Librandi, Feb 19 2015 *)
  • PARI
    vector(100, n, 2*prime(n) - 4) \\ Michel Marcus, Jan 09 2015
    

Formula

a(n) = 2*A040976(n). - Michel Marcus, Jan 09 2015

Extensions

More terms from Robert G. Wilson v and R. J. Mathar, May 30 2008

A182618 Number of new grid points that are covered by the toothpicks added at n-th-stage to the toothpick spiral of A182617.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Dec 12 2010

Keywords

Comments

In the toothpick spiral the toothpicks are connected by their endpoints. See A182617 for more information.
Attempt at an explanation, R. J. Mathar, Dec 13 2010: (Start)
In the hexagonal grid, we can pick any of the hexagons as a center, and then define a ring of 6 first neighbors (hexagons adjacent to the center), then define a ring of 12 second neighbors (hexagons adjacent to any of the first ring) and so on. The current sequence describes a self-avoiding walk which starts in a spiral around the center hexagon, which covers 5 edges. The walk then takes one step to reach the rim of the first ring and travels once around this ring until it reaches a point where self-avoidance stops it. It then takes one step to reach the rim of the second ring and walks around that one, etc. Imagine that on each edge we place a toothpick if it's on the path, and interrupt counting the total number of toothpicks each time one of the hexagons has six vertices covered. The first differences of these intermediate totals define the sequence. (End)

Examples

			At stage 1, starting from a node on the hexagonal net, we place 5 toothpicks on 5 edges of the first hexagon, so a(1)= 6 because there are 6 grid points that are covered by the toothpicks.
At stage 2, starting from the last exposed endpoints, we place 4 toothpicks on the edges of the second hexagon, so a(2)=4 because there are new 4 grid points that are covered by the toothpicks.
At stage 3, starting from the last exposed endpoints we place 3 toothpicks on the edges of the third hexagon, so a(3)=3 because there are new 3 grid points covered. Etc.
If written as a triangle, begins:
6,
4,3,3,3,3,2,
3,3,2,3,2,3,2,3,2,3,2,2,
3,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,2,
3,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,2,
3,2,2,2,3,2,2,2,2,3,2,2,2,2,3,2,2,2,2,3,2,2,2,2,3,2,2,2,2,2
		

Crossrefs

Row n has A008458(n-1) terms. Row sums give A017593.

A157517 a(n) = 7 + 12*n - 6*n^2.

Original entry on oeis.org

7, 13, 7, -11, -41, -83, -137, -203, -281, -371, -473, -587, -713, -851, -1001, -1163, -1337, -1523, -1721, -1931, -2153, -2387, -2633, -2891, -3161, -3443, -3737, -4043, -4361, -4691, -5033, -5387, -5753, -6131, -6521, -6923, -7337, -7763, -8201, -8651
Offset: 0

Views

Author

Paul Curtz, Mar 02 2009

Keywords

Comments

From John Couch Adams multisteps integration of differential equations, 1855.

References

  • P. Curtz Integration numerique des systemes differentiels, C.C.S.A., Arcueil, 1969, p. 36.

Programs

Formula

a(n) = 12*n + 6 - A140811(n) = A017593(n) - A140811(n).
Recurrences: a(n) = 2*a(n-1) - a(n-2) - 12 = 3*a(n-1) - 3*a(n-2) + a(n-3).
First differences: a(n+1) - a(n) = -A017593(n-1), n > 0. Second differences are all -12.
a(n+2) - a(n) = -A008606(n).
G.f.: (-7 + 8*x + 11*x^2)/(x-1)^3. - R. J. Mathar, Mar 15 2009

Extensions

Edited and extended by R. J. Mathar, Mar 15 2009

A216972 a(4n+2) = 2, otherwise a(n) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 2, 7, 8, 9, 2, 11, 12, 13, 2, 15, 16, 17, 2, 19, 20, 21, 2, 23, 24, 25, 2, 27, 28, 29, 2, 31, 32, 33, 2, 35, 36, 37, 2, 39, 40, 41, 2, 43, 44, 45, 2, 47, 48, 49, 2, 51, 52, 53, 2, 55, 56, 57, 2, 59, 60, 61, 2, 63, 64, 65, 2, 67, 68, 69, 2
Offset: 0

Views

Author

Paul Curtz, Sep 21 2012

Keywords

Comments

For n>0, a(n) is the denominator of A214282(n)/(-A214283(n+1)):
1/1, 1/2, 1/3, 3/4, 3/5, 1/2, 3/7, 5/8, 5/9, ...
For n>0, a(n) is the denominator of A214283(n)/A214283(n+1):
0/1, 1/2, 2/3, 3/4, 2/5, 1/2, 4/7, 5/8, 4/9, ...
a(n), first and second differences:
0, 1, 2, 3, 4, 5, 2, 7, 8, 9, 2, 11, 12, ...
1, 1, 1, 1, 1, -3, 5, 1, 1, -7, 9, 1, 1, ...
0, 0, 0, 0, -4, 8, -4, 0, -8, 16, -8, 0, -12, ...

Crossrefs

Programs

  • Magma
    [n mod 4 eq 2 select 2 else n: n in [0..70]]; // Bruno Berselli, Sep 26 2012
    
  • Mathematica
    a[n_] := If[Mod[n, 4] == 2, 2, n]; Table[a[n], {n, 0, 81}] (* Jean-François Alcover, Sep 25 2012 *)
    LinearRecurrence[{0,0,0,2,0,0,0,-1},{0,1,2,3,4,5,2,7},80] (* Harvey P. Dale, Nov 06 2017 *)
  • Maxima
    makelist(expand(2+(4-(1+(-1)^n)*(1-%i^n))*(n-2)/4), n, 0, 70); /* Bruno Berselli, Sep 26 2012 */
    
  • Python
    def A216972(n): return 2 if n&3==2 else n # Chai Wah Wu, Jan 31 2024

Formula

a(n) = 2*a(n-4) - a(n-8).
a(n+4) - a(n) = 4*A152822(n).
a(2n) + a(2n+1) = |A141124(n)|.
a(4n) + a(4n+1) + a(4n+2) + a(4n+3) = 6*A005408(n) = A017593(n).
G.f.: (x+2*x^2+3*x^3+4*x^4+3*x^5-2*x^6+x^7) / (1-2*x^4+x^8). - Jean-François Alcover, Sep 25 2012
a(n) = 2+(4-(1+(-1)^n)*(1-i^n))*(n-2)/4, where i=sqrt(-1). - Bruno Berselli, Sep 26 2012
a(2n) = 2*|A009531(n)|, a(2n+1) = 2n+1. - Bruno Berselli, Sep 27 2012

A174012 a(n) = 3 * A064680(n).

Original entry on oeis.org

0, 6, 3, 18, 6, 30, 9, 42, 12, 54, 15, 66, 18, 78, 21, 90, 24, 102, 27, 114, 30, 126, 33, 138, 36, 150, 39, 162, 42, 174, 45, 186, 48, 198, 51, 210, 54, 222, 57, 234, 60, 246, 63, 258, 66, 270, 69, 282, 72, 294, 75, 306, 78, 318, 81, 330, 84, 342, 87, 354, 90, 366, 93, 378, 96
Offset: 0

Views

Author

Paul Curtz, Mar 05 2010

Keywords

Crossrefs

Formula

a(n) = A064680(3*n), similar to A165988.
a(n) mod 9 = 3*A080425(n) (period length 3).
a(2n+1) = A017593(n).
a(2n) = A008585(n).

Extensions

a(0) = 0 prepended by Georg Fischer, Jul 01 2020

A233207 Triangle T(n,k), read by rows, given by T(n+k,k)=2*k*(2*n+1).

Original entry on oeis.org

0, 0, 2, 0, 6, 4, 0, 10, 12, 6, 0, 14, 20, 18, 8, 0, 18, 28, 30, 24, 10, 0, 22, 36, 42, 40, 30, 12, 0, 26, 44, 54, 56, 50, 36, 14, 0, 30, 52, 66, 72, 70, 60, 42, 16, 0, 34, 60, 78, 88, 90, 84, 70, 48, 18, 0, 38, 68, 90, 104, 110, 108, 98, 80, 54, 20, 0, 42, 76, 102
Offset: 0

Views

Author

Philippe Deléham, Dec 05 2013

Keywords

Comments

Row sums are A006331(n).
Diagonal sums are A212964(n+1).
T(2n,n)=A002943(n).

Examples

			Triangle begins:
  0
  0, 2
  0, 6, 4
  0, 10, 12, 6
  0, 14, 20, 18, 8
  0, 18, 28, 30, 24, 10
		

Crossrefs

Formula

T(n+k,k) = A005843(k)*A005408(n).
Sum_{k=0..n} T(n,k) = n*(n+1)*(2*n+1)/3 = A006331(n).

A285440 Consider the sums of the numbers < n that share the same greatest common divisor with n. Sequence lists numbers that have only one of those sums equal to n.

Original entry on oeis.org

3, 4, 8, 9, 15, 16, 20, 21, 27, 28, 32, 33, 39, 40, 44, 45, 51, 52, 56, 57, 63, 64, 68, 69, 75, 76, 80, 81, 87, 88, 92, 93, 99, 100, 104, 105, 111, 112, 116, 117, 123, 124, 128, 129, 135, 136, 140, 141, 147, 148, 152, 153, 159, 160, 164, 165, 171, 172, 176, 177
Offset: 1

Views

Author

Paolo P. Lava, Apr 19 2017

Keywords

Comments

Numbers with no sum equal to n are listed in A108118, with two sums equal to n are listed in A017593 and with three sums equal to n in A008594.
First difference has period 4: {1,4,1,6}.
Numbers that are congruent to {3, 4, 8, 9} mod 12. - Amiram Eldar, Dec 31 2021

Examples

			20 is in the sequence because:
gcd(k,20) = 1 for k = 1, 3, 7, 9, 11, 13, 17, 19: sum is 80.
gcd(k,20) = 2 for k = 2, 6, 14, 18: sum is 40.
gcd(k,20) = 4 for k = 4, 8, 12, 16: sum is 40.
gcd(k,20) = 5 for k = 5, 15: sum is 20.
gcd(k,20) = 10 for k = 10: sum is 10.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,k,n,t;
    for n from 1 to q do a:=array(1..n-1); for k from 1 to n-1 do a[k]:=0; od;
    for k from 1 to n-1 do a[gcd(n,k)]:=a[gcd(n,k)]+k; od; t:=0;
    for k from 1 to n-1 do if a[k]=n then t:=t+1; fi; od; if t=1 then print(n); fi;
    od; end: P(10^6);
  • Mathematica
    Flatten@ Position[#, k_ /; Length@ k == 1] &@ Table[Select[Transpose@ {Values@ #, Keys@ #} &@ Map[Total, PositionIndex@ Map[GCD @@ {n, #} &, Range[n - 1]]], First@ # == n &][[All, -1]], {n, 180}] (* Michael De Vlieger, Apr 28 2017, Version 10 *)
    LinearRecurrence[{1, 0, 0, 1, -1}, {3, 4, 8, 9, 15}, 60] (* Amiram Eldar, Dec 31 2021 *)
  • PARI
    a(n) = n--; [3, 4, 8, 9][n%4+1] + 12*(n\4) \\ David A. Corneth, Apr 28 2017
    
  • PARI
    is(n) = {my(d=divisors(n), map=vector(d[#d-1]), v=vector(#d-1)); for(i=1,#d-1, map[d[i]]=i); for(i=1,n-1,v[map[gcd(i, n)]]+=i); sum(i=1,#v,v[i]==n)==1} \\ David A. Corneth, Apr 28 2017
    
  • PARI
    is(n) = vecsort(concat([3, 4, 8, 9], [n%12]), ,8)==[3, 4, 8, 9] \\ David A. Corneth, Apr 28 2017

Formula

From Chai Wah Wu, Nov 01 2018: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: x*(3*x^4 + x^3 + 4*x^2 + x + 3)/(x^5 - x^4 - x + 1). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (3-sqrt(3))*Pi/36. - Amiram Eldar, Dec 31 2021
Previous Showing 11-20 of 20 results.