login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A152188
a(0) = 0, a(n) is the number of divisors of n that are greater than a(n-1).
1
0, 1, 1, 1, 2, 1, 3, 1, 3, 1, 3, 1, 5, 1, 3, 2, 3, 1, 5, 1, 5, 2, 2, 1, 7, 1, 3, 2, 4, 1, 7, 1, 5, 2, 2, 3, 6, 1, 3, 2, 6, 1, 7, 1, 5, 3, 2, 1, 9, 1, 5, 2, 4, 1, 7, 2, 6, 2, 2, 1, 11, 1, 3, 4, 4, 3, 5, 1, 5, 2, 6, 1, 11, 1, 3, 4, 3, 3, 5, 1, 9, 2, 2, 1, 11, 2, 2, 3, 6, 1, 11, 2, 4, 2, 2, 3, 9, 1, 5, 4, 6, 1, 7, 1, 7, 4
OFFSET
0,5
COMMENTS
a(n) for prime n equals 1, but a value of 1 does not imply primality (e.g., a(9) = 1 but 9 is the square of a prime).
a(n) = 1 does imply the primality of n if n > 1260. (see Math StackExchange link)
a(n) can never exceed floor(n/2) for n > 1.
a(n) for even n greater than 2 can never equal 1.
EXAMPLE
For n = 6, we have a(n) = 3 as 2, 3, and 6 are greater than 1 and 1 = a(5).
MATHEMATICA
a[0] := 0; a[n_] := a[n] = Length[Select[Divisors[n], # > a[n - 1] &]]; Table[a[n], {n, 0, 99}] (* Alonso del Arte, Sep 24 2011 *)
PROG
(Java)
import java.util.Set; import java.util.TreeSet;
public class Seq1 { public static final int TOCALC = 50; public static void main(String[] args) { int[] terms = new int[TOCALC]; terms[0] = 0; terms[1] = 1; Set<Integer> uniqueFactors = new TreeSet<Integer>(); for(int n = 2; n <= TOCALC - 1; n++){ for(int i = 1; i <= n; i++){ if(n % i == 0){ uniqueFactors.add(i); } } int counter = 0; for(int test : uniqueFactors){ if(test > terms[n - 1]){ counter++; } } terms[n] = counter; uniqueFactors.clear(); } int newLine = 0; for(int d = 0; d <= TOCALC - 1; d++){ System.out.print(terms[d] + ", "); newLine++; if(newLine == 10){ System.out.println(); newLine = 0; } } int max = 0; for(int f = 0; f <= TOCALC - 1; f++){ max = Math.max(max, terms[f]); } System.out.println(); System.out.print("Max: " + max); }}
(PARI)
up_to = 105;
v152188 = vector(up_to);
v152188[1] = 1;
A152188(n) = if(n<=1, n, my(prev = v152188[n-1], res = sumdiv(n, d, (d>prev))); v152188[n] = res; (res)); \\ Must be called in order of increasing n.
for(n=0, up_to, print1(A152188(n), ", ")); \\ Antti Karttunen, Mar 06 2018
CROSSREFS
Sequence in context: A378445 A029242 A029236 * A239930 A226859 A025820
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Antti Karttunen, Mar 06 2018
STATUS
approved