A161664
a(n) = Sum_{i=1..n} (i - d(i)), where d(n) is the number of divisors of n (A000005).
Original entry on oeis.org
0, 0, 1, 2, 5, 7, 12, 16, 22, 28, 37, 43, 54, 64, 75, 86, 101, 113, 130, 144, 161, 179, 200, 216, 238, 260, 283, 305, 332, 354, 383, 409, 438, 468, 499, 526, 561, 595, 630, 662, 701, 735, 776, 814, 853, 895, 940, 978, 1024, 1068, 1115, 1161, 1212, 1258, 1309
Offset: 1
a(8) in A000217 minus a(8) in A006218 = a(7) above (28-16=12).
Referring to the chart referenced, when n-th year = 7 there are 16 x-markers.
These represent unsafe periods for cicada emergence: 28-16=12 safe periods.
The percent of safe periods for the entire 7 years is 12/28=~42.86%; for year 7 alone the calculation is 5/7 = 71.43%, a relatively good time to emerge.
- Enoch Haga, Eratosthenes goes bugs! Exploring Prime Numbers, 2007, pp 71-80; first publication 1994.
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
- A. Baker, Are there Genuine Mathematical Explanations of Physical Phenomena?, Mind 114 (454) (2005) 223-238.
- Enoch Haga, Prime Safe Periods
- G. F. Webb, The prime number periodical Cicada problem, Discr. Cont. Dyn. Syst. 1 (3) (2001) 387.
- Wildforests, Cicada, visited Dec. 2012. - From _N. J. A. Sloane_, Dec 25 2012
-
with(numtheory): A161664:=n->add(i-tau(i), i=1..n): seq(A161664(n), n=1..100); # Wesley Ivan Hurt, Jul 15 2014
# second Maple program:
a:= proc(n) option remember; `if`(n<1, 0,
a(n-1)+n-numtheory[tau](n))
end:
seq(a(n), n=1..55); # Alois P. Heinz, Jun 24 2022
-
a[n_] := n*(n+1)/2 - Sum[ DivisorSigma[0, k], {k, n}]; Table[a[n], {n, 55}] (* Jean-François Alcover, Nov 07 2011 *)
-
from math import isqrt
def A161664(n): return (lambda m: n*(n+1)//2+m*m-2*sum(n//k for k in range(1, m+1)))(isqrt(n)) # Chai Wah Wu, Oct 08 2021
Simplified definition, offset corrected and partially edited by
Omar E. Pol, Jun 18 2009
A068063
Maximum cardinality of a nondividing subset of {1, 2, ..., n}.
Original entry on oeis.org
0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8
Offset: 0
a(65) = 8 because 8 is the maximal cardinality of a nondividing subset of {1, 2, ..., 65}. Two different subsets have cardinality 8:
{36,40,48,49,53,61,64,65}, {30,44,45,49,50,59,64,65}.
A051014
Number of nondividing sets on {1,2,...,n}.
Original entry on oeis.org
1, 2, 3, 5, 7, 11, 14, 21, 27, 38, 52, 73, 90, 123, 159, 211, 263, 344, 413, 535, 658, 832, 1026, 1276, 1499, 1846, 2226, 2708, 3229, 3912, 4592, 5541, 6495, 7795, 9207, 10908, 12547, 14852, 17358, 20493, 23709, 27744, 31921, 37250, 43013, 49936, 57319, 66318
Offset: 0
a(5) = 11 because there are 11 nondividing subsets of {1,2,3,4,5}: {}, {1}, {2}, {3}, {4}, {5}, {2,3}, {2,5}, {3,4}, {3,5}, {4,5}.
a(7) = 21: {}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {2,3}, {2,5}, {2,7}, {3,4}, {3,5}, {3,7}, {4,5}, {4,6}, {4,7}, {5,6}, {5,7}, {6,7}, {4,6,7}.
-
sums:= proc(s) option remember; local i, m;
m:= max(s[]);
`if`(m<1, {}, {m, seq([i,i+m][], i=sums(s minus {m}))})
end:
b:= proc(i,s) option remember; local j, ok, t, si;
if i<2 then 1
else si:= s union {i};
ok:= true;
for j in sums(si) while ok do
for t in si while ok do
if irem(j, t)=0 and t<>j then ok:= false fi
od
od;
b(i-1,s) +`if`(ok, b(i-1, si), 0)
fi
end:
a:= n-> `if`(n=0, 1, 1+b(n, {})):
seq(a(n), n=0..25); # Alois P. Heinz, Mar 08 2011
-
sums[s_] := sums[s] = Module[{m=Max[s]},
If[m<1, {},
Join[{m},
Sequence@@Table[{i,i+m}, {i,sums[DeleteCases[s,m]]}]]]
];
b[i_,s_] := b[i,s] = Module[{ ok,si,sij,sik},
If[ i<2, 1, si = Union[s,{i}];
ok = True;
For[j=1, j <= Length[sums[si]] && ok, j++,
sij = sums[si][[j]];
For[k=1, k <= Length[si] && ok, k++,
If[Divisible[sij,sik=si[[k]]]&&sij!=sik,ok=False]]];
b[i-1, s] + If[ok, b[i-1,si],0]
]
];
a[n_] := a[n] = If[n==0, 1, 1+b[n, {}]];
Table[ Print[ a[n] ]; a[n], {n,0,47}]
(* Jean-François Alcover, Oct 10 2012, after Alois P. Heinz *)
A187490
Number of 3-element nondividing subsets of {1, 2, ..., n}.
Original entry on oeis.org
1, 2, 6, 12, 22, 31, 49, 70, 99, 128, 176, 216, 284, 343, 423, 515, 633, 722, 860, 1007, 1173, 1333, 1552, 1729, 1989, 2223, 2502, 2809, 3138, 3416, 3819, 4226, 4658, 5049, 5570, 6016, 6601, 7146, 7719, 8371, 9100, 9686, 10461, 11208, 12039
Offset: 7
a(7) = 1 because there is one 3-element nondividing subset of {1,2,3,4,5,6,7}: {4,6,7}.
a(9) = 6: {4,6,7}, {4,6,9}, {5,6,8}, {5,8,9}, {6,7,9}, {6,8,9}.
A187491
Number of 4-element nondividing subsets of {1, 2, ..., n}.
Original entry on oeis.org
1, 2, 3, 6, 10, 21, 32, 49, 65, 101, 150, 224, 305, 413, 525, 707, 908, 1174, 1479, 1871, 2269, 2826, 3396, 4138, 4967, 5991, 6917, 8244, 9673, 11328, 12958, 15091, 17112, 19771, 22468, 25485, 28870, 32861, 36298, 40969, 45615, 51015
Offset: 10
a(10) = 1 because there is one 4-element nondividing subset of {1,2,...,10}: {6,7,9,10}.
A187492
Number of 5-element nondividing subsets of {1, 2, ..., n}.
Original entry on oeis.org
2, 4, 6, 11, 15, 24, 50, 83, 127, 209, 310, 431, 679, 921, 1229, 1624, 2145, 2770, 3752, 4866, 6141, 7753, 9679, 12005, 15027, 18134, 22045, 26368, 31712, 37763, 45569, 53810, 63393, 73560, 86496, 100071, 117234, 134623, 155465, 176876
Offset: 21
a(21) = 2 because there are two 5-element nondividing subsets of {1,2,...,21}: {12,16,18,19,21}, {12,14,18,20,21}.
A187493
Number of 6-element nondividing subsets of {1, 2, ..., n}.
Original entry on oeis.org
1, 3, 4, 7, 15, 27, 45, 55, 85, 133, 199, 262, 378, 534, 803, 999, 1319, 1742, 2309, 3007, 4020, 5166, 6565, 7950, 10380, 12882, 16533, 19664, 24099, 30912, 37550, 44092, 54465, 65117, 79616, 94144, 111780, 132592, 159228, 187506, 219949, 256514
Offset: 31
a(31) = 1 because there is one 6-element nondividing subset of {1,2,...,31}: {16,19,23,24,28,31}.
A187494
Number of 7-element nondividing subsets of {1, 2, ..., n}.
Original entry on oeis.org
1, 1, 3, 3, 5, 5, 9, 12, 21, 27, 41, 46, 74, 99, 137, 153, 203, 307, 414, 464, 612, 788, 1126, 1292, 1645, 2039, 2614, 3291, 4120, 5127, 6356, 7180, 9786
Offset: 43
a(43) = 1 because there is one 7-element nondividing subset of {1,2,...,43}: {24,28,31,35,36,40,43}.
A187550
Number of 8-element nondividing subsets of {1, 2, ..., n}.
Original entry on oeis.org
2, 3, 4, 5, 6, 9, 12, 15, 19, 24, 35, 46, 60, 83, 102, 135
Offset: 65
a(65) = 2 because there are two 8-element nondividing subsets of {1,2,...,65}: {36,40,48,49,53,61,64,65}, {30,44,45,49,50,59,64,65}.
Showing 1-9 of 9 results.
Comments