Nathaniel J. Strout has authored 5 sequences.
A327439
a(0)=1. If a(n-1) and n are relatively prime and a(n-1)!=1, a(n) = a(n-1) - 1. Otherwise (i.e., if a(n-1) and n share a common factor or a(n-1)=1), a(n) = a(n-1) + gcd(a(n-1),n) + 1.
Original entry on oeis.org
1, 3, 2, 1, 3, 2, 5, 4, 9, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 3, 2, 5, 4, 9, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 3, 2, 5, 4, 7, 6, 9, 8, 11, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11
Offset: 0
-
a[0] = 1; a[n_] := a[n] = If[a[n - 1] != 1 && CoprimeQ[n, a[n - 1]], a[n - 1] - 1, a[n - 1] + GCD[a[n - 1], n] + 1]; Array[a, 101, 0] (* Amiram Eldar, Feb 24 2020 *)
nxt[{n_,a_}]:={n+1,If[CoprimeQ[n+1,a]&&a!=1,a-1,a+GCD[a,n+1]+1]}; NestList[nxt,{0,1},70][[;;,2]] (* Harvey P. Dale, Jun 08 2024 *)
-
import math
import matplotlib.pyplot as plt
num = 10000
x = []
y = []
# y is the main sequence
def sequence():
a = 1
y.append(a)
for i in range(num):
if (a != 1) and (math.gcd(a,i+1) == 1):
a -= 1
else:
a += math.gcd(a,i+1)+1
x.append(i)
y.append(a)
x.append(num)
sequence()
# code only regarding the plot.
plt.xlim(0,num)
plt.ylim(0,num)
plt.plot(x, y)
plt.xlabel('x - axis')
plt.ylabel('y - axis')
plt.title('Plot of Sequence')
plt.show()
A330190
Symmetric matrix read by antidiagonals: f(i,j) = 1 + gcd(f(i-1,j), f(i,j-1)), where f(1,j) and f(i,1) are 1.
Original entry on oeis.org
1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 3, 3, 3, 2, 1, 1, 2, 2, 4, 4, 2, 2, 1, 1, 2, 3, 3, 5, 3, 3, 2, 1, 1, 2, 2, 4, 2, 2, 4, 2, 2, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 2, 2, 4, 4, 4, 4, 4, 4, 2, 2, 1, 1, 2, 3, 3, 5, 5, 5, 5, 5, 3, 3, 2, 1
Offset: 1
An example of a triangle described in the comment:
...........
...........
..........2
........2 3
......2 3 4
....2 3 4 5
Array begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, ...
1, 2, 3, 2, 3, 2, 3, 2, 3, 2, ...
1, 2, 2, 3, 4, 3, 4, 3, 4, 3, ...
1, 2, 3, 4, 5, 2, 3, 4, 5, 2, ...
1, 2, 2, 3, 2, 3, 4, 5, 6, 3, ...
1, 2, 3, 4, 3, 4, 5, 6, 7, 2, ...
1, 2, 2, 3, 4, 5, 6, 7, 8, 3, ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 4, ...
1, 2, 2, 3, 2, 3, 2, 3, 4, 5, ...
...
-
f[1, j_] := f[1, j] = 1; f[i_, 1] := f[i, 1] = 1; f[i_, j_] := f[i, j] = 1 + GCD[f[i - 1, j], f[i, j - 1]]; Table[f[m - k + 1, k], {m, 13}, {k, m, 1, -1}] // Flatten (* Michael De Vlieger, Aug 03 2022 *)
-
T(n)={my(M=matrix(n,n,i,j,1)); for(i=2, n, for(j=2, n, M[i,j] = 1 + gcd(M[i-1,j], M[i,j-1]))); M}
{ my(A=T(10)); for(i=1, #A, print(A[i,])) } \\ Andrew Howroyd, Jan 25 2020
A321297
a(n) is the sum of proper divisors of n that are >= sqrt(n) minus the sum of the divisors that are greater than 1 and less than sqrt(n).
Original entry on oeis.org
0, 0, 0, 2, 0, 1, 0, 2, 3, 3, 0, 5, 0, 5, 2, 10, 0, 10, 0, 9, 4, 9, 0, 17, 5, 11, 6, 15, 0, 21, 0, 18, 8, 15, 2, 36, 0, 17, 10, 27, 0, 31, 0, 27, 16, 21, 0, 45, 7, 28, 14, 33, 0, 43, 6, 37, 16, 27, 0, 67, 0, 29, 20, 50, 8, 55, 0, 45, 20, 45, 0, 76, 0, 35, 32
Offset: 1
-
Array[Function[{d, s}, 1 + Subtract @@ (Total /@ Reverse@ TakeDrop[d, LengthWhile[d, # < s &]])] @@ {Most@ Divisors[#], Sqrt@ #} &, 74, 2] (* Michael De Vlieger, Nov 25 2018 *)
-
a(n)=sumdiv(n, d, if(d>1&&d=n/d, d, -d)))
A304780
Consider a triangle whose first row is {1,2} and, for n > 1, has as its n-th row the integers k through 2k where k is the sum of the numbers in the (n-1)th row. Then a(n) is the first number in the n-th row.
Original entry on oeis.org
1, 3, 18, 513, 395523, 234658258578, 82596747478641253260993, 10233334041075645341729789249315281196742910563, 157081688394356396673208173772909833928515988895188885472258972148661958252271815996039831298
Offset: 1
Triangle begins:
1, 2; (row sum = 3)
3, 4, 5, 6; (row sum = 18)
18, 19, 20, 21, ... 33, 34, 35, 36; (row sum = 513)
513, 514, 515, 516, ..., 1023, 1024, 1025, 1026;
...
-
RecurrenceTable[{a[1] == 1, a[n] == (3*a[n-1]*(a[n-1] + 1))/2}, a, {n, 1, 10}] (* Vaclav Kotesovec, Jul 23 2018 *)
Nest[Append[#, Range[#, 2 #] &@ Total@ Last@ #] &, {{1, 2}}, 3] // Flatten (* Michael De Vlieger, Jul 26 2018 *)
-
a(n) = if (n==1, 1, (3*a(n - 1)*(a(n - 1) + 1))/2); \\ Michel Marcus, May 24 2018
A296422
Primes that can be represented in the form b^n+1 or b^n-1 where b >= 2 and n >= 2.
Original entry on oeis.org
3, 5, 7, 17, 31, 37, 101, 127, 197, 257, 401, 577, 677, 1297, 1601, 2917, 3137, 4357, 5477, 7057, 8101, 8191, 8837, 12101, 13457, 14401, 15377, 15877, 16901, 17957, 21317, 22501, 24337, 25601, 28901, 30977, 32401, 33857, 41617, 42437, 44101, 50177, 52901
Offset: 1
-
N:= 10^5: # to get terms <= N
R:= 3:
for b from 2 while b^2+1 <= N do
p:= 2:
do
p:= nextprime(p);
if b^p-1 > N then break fi;
if isprime(b^p-1) then R:= R, b^p-1 fi;
od:
p:= 1:
do
p:= 2*p;
if b^p+1 > N then break fi;
if isprime(b^p+1) then R:= R, b^p+1 fi;
od;
od:
sort(convert({R},list)); # Robert Israel, Jan 08 2018
-
Select[Prime@ Range[2, 10^4], AnyTrue[# + {-1, 1}, Or[# == 1, GCD @@ FactorInteger[#][[All, -1]] > 1] &] &] (* Michael De Vlieger, Dec 13 2017 *)
-
lista(nn) = {forprime(p=2, nn, if ((p==2) || ispower(p+1) || ispower(p-1), print1(p, ", ")); ); } \\ Michel Marcus, Dec 13 2017
Comments