|
| |
|
|
A152188
|
|
a(0) = 0, a(n) is the number of divisors of n that are greater than a(n - 1)
|
|
0
| |
|
|
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
(list; graph; refs; listen; history; internal format)
|
|
|
|
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) 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); }}
|
|
|
CROSSREFS
| Sequence in context: A116372 A029242 A029236 * A025820 A109704 A073407
Adjacent sequences: A152185 A152186 A152187 * A152189 A152190 A152191
|
|
|
KEYWORD
| nonn
|
|
|
AUTHOR
| Christopher Williamson (traveler.cw(AT)gmail.com), Sep 24 2011
|
| |
|
|