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.

Showing 1-10 of 19 results. Next

A263271 Square array A(row,col): A(row,0) = row and for col >= 1, if A262686(row) is 0, then A(row,col) = 0, otherwise A(row,col) = A(A262686(row),col-1).

Original entry on oeis.org

0, 2, 1, 6, 4, 2, 12, 8, 6, 3, 18, 0, 12, 5, 4, 22, 0, 18, 7, 8, 5, 30, 0, 22, 0, 0, 7, 6, 34, 0, 30, 0, 0, 0, 12, 7, 42, 0, 34, 0, 0, 0, 18, 0, 8, 46, 0, 42, 0, 0, 0, 22, 0, 0, 9, 54, 0, 46, 0, 0, 0, 30, 0, 0, 11, 10, 58, 0, 54, 0, 0, 0, 34, 0, 0, 16, 14, 11
Offset: 0

Views

Author

Antti Karttunen, Nov 29 2015

Keywords

Comments

The square array A(row>=0, col>=0) is read by downwards antidiagonals as: A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), A(0,3), A(1,2), A(2,1), A(3,0), ...
Each row n lists all the nodes in A263267-tree that one encounters when one starts from node n and always chooses the largest possible child of it (A262686), and then the largest possible child of that child, etc, until a leaf-child (one of the terms of A045765) is encountered, after which the rest of the row contains only zeros.

Examples

			The top left corner of the array:
   0,  2,  6, 12, 18, 22, 30, 34, 42, 46, 54, 58, 66,  0,  0,  0,  0
   1,  4,  8,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   2,  6, 12, 18, 22, 30, 34, 42, 46, 54, 58, 66,  0,  0,  0,  0,  0
   3,  5,  7,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   4,  8,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   5,  7,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   6, 12, 18, 22, 30, 34, 42, 46, 54, 58, 66,  0,  0,  0,  0,  0,  0
   7,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   8,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   9, 11, 16, 24,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  10, 14, 20,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  11, 16, 24,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  12, 18, 22, 30, 34, 42, 46, 54, 58, 66,  0,  0,  0,  0,  0,  0,  0
  13,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  14, 20,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  15, 17, 21, 23, 27, 36,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
  ...
		

Crossrefs

Column 0: A001477, Column 1: A262686.
Cf. A264971 (number of significant terms on each row, position where the first trailing zero-term occurs).
Cf. A264970.
Cf. also A000005, A045765, A263267.
See also array A265751 constructed in the same way, but obtained by following always the smallest child A082284, instead of the largest child A262686.

Programs

  • Scheme
    (define (A263271 n) (A263271bi (A002262 n) (A025581 n)))
    (define (A263271bi row col) (cond ((zero? col) row) ((A262686 row) => (lambda (lad) (if (zero? lad) lad (A263271bi lad (- col 1)))))))
    ;; An alternative implementation, reflecting the new recurrence:
    (define (A263271bi row col) (cond ((zero? col) row) ((and (zero? row) (= 1 col)) 2) ((zero? (A263271bi row (- col 1))) 0) (else (A262686 (A263271bi row (- col 1))))))

Formula

A(row,0) = row and for col >= 1, if A262686(row) is 0, then A(row,col) = 0, otherwise A(row,col) = A(A262686(row),col-1).
A(0,0) = 0, A(0,1) = 2; if col = 0, A(row,0) = row; and for col > 0, if A(row,col-1) = 0, then A(row,col) = 0, otherwise A(row,col) = A262686(A(row,col-1)). [Another, perhaps more intuitive recurrence for this array.] - Antti Karttunen, Dec 21 2015

A264970 If A262686(n) = 0, a(n) = 0, otherwise a(n) = 1 + a(A262686(n)), where A262686(n) = largest number k such that k - d(k) = n, or 0 if no such number exists, and d(n) = the number of divisors of n (A000005).

Original entry on oeis.org

12, 2, 11, 2, 1, 1, 10, 0, 0, 3, 2, 2, 9, 0, 1, 5, 1, 4, 8, 0, 0, 3, 7, 2, 0, 0, 2, 1, 0, 1, 6, 6, 1, 0, 5, 5, 0, 0, 6, 4, 0, 1, 4, 0, 1, 3, 3, 2, 5, 0, 0, 1, 0, 2, 2, 0, 0, 1, 1, 4, 4, 3, 3, 0, 0, 2, 0, 0, 0, 1, 2, 3, 3, 2, 0, 0, 2, 1, 4, 0, 1, 1, 3, 3, 2, 0, 2, 2, 0, 4, 3, 1, 1, 3, 2, 5, 1, 4, 0, 2, 0
Offset: 0

Views

Author

Antti Karttunen, Nov 29 2015

Keywords

Comments

a(n) = number of iterations of A262686 needed before zero is reached. In the context of tree (A263267) defined by edge-relation A049820(child) = parent, this is the number of hops we make before reaching one of the leaves (A045765), when we start from n and always select the largest child at each iteration.

Crossrefs

Cf. A045765 (positions of zeros).
One less than A264971.

Formula

If A060990(n) = 0, a(n) = 0, otherwise a(n) = 1 + a(A262686(n)).
Other identities. For all n >= 0:
a(n) = A264971(n) - 1.

A264971 If A262686(n) = 0, a(n) = 1, otherwise a(n) = 1 + a(A262686(n)), where A262686(n) = largest number k such that k - d(k) = n, or 0 if no such number exists, and d(n) = the number of divisors of n (A000005).

Original entry on oeis.org

13, 3, 12, 3, 2, 2, 11, 1, 1, 4, 3, 3, 10, 1, 2, 6, 2, 5, 9, 1, 1, 4, 8, 3, 1, 1, 3, 2, 1, 2, 7, 7, 2, 1, 6, 6, 1, 1, 7, 5, 1, 2, 5, 1, 2, 4, 4, 3, 6, 1, 1, 2, 1, 3, 3, 1, 1, 2, 2, 5, 5, 4, 4, 1, 1, 3, 1, 1, 1, 2, 3, 4, 4, 3, 1, 1, 3, 2, 5, 1, 2, 2, 4, 4, 3, 1, 3, 3, 1, 5, 4, 2, 2, 4, 3, 6, 2, 5, 1, 3, 1
Offset: 0

Views

Author

Antti Karttunen, Nov 29 2015

Keywords

Comments

See comments at A264970.

Crossrefs

One more than A264970.
Number of significant terms on row n of A263271.

Formula

If A060990(n) = 0, a(n) = 1, otherwise a(n) = 1 + a(A262686(n)).
Other identities. For all n >= 0:
a(n) = 1 + A264970(n).

A060990 Number of solutions to x - d(x) = n, where d(n) is the number of divisors of n (A000005).

Original entry on oeis.org

2, 2, 1, 1, 1, 1, 3, 0, 0, 1, 1, 3, 1, 0, 1, 1, 1, 2, 1, 0, 0, 1, 4, 1, 0, 0, 1, 2, 0, 2, 1, 1, 1, 0, 2, 2, 0, 0, 2, 2, 0, 1, 1, 0, 1, 1, 3, 1, 2, 0, 0, 2, 0, 1, 1, 0, 0, 3, 2, 1, 1, 1, 2, 0, 0, 2, 0, 0, 0, 2, 4, 1, 1, 1, 0, 0, 1, 1, 2, 0, 1, 2, 1, 1, 1, 0, 1, 2, 0, 1, 1, 2, 1, 1, 1, 1, 2, 1, 0, 1, 0, 1, 3, 0, 1, 1
Offset: 0

Views

Author

Labos Elemer, May 11 2001

Keywords

Comments

If x-d(x) is never equal to n, then n is in A045765 and a(n) = 0.
Number of solutions to A049820(x) = n. - Jaroslav Krizek, Feb 09 2014

Examples

			a(11) = 3 because three numbers satisfy equation x-d(x)=11, namely {13,15,16} with {2,4,5} divisors respectively.
		

Crossrefs

Cf. A045765 (positions of zeros), A236562 (positions of nonzeros), A262511 (positions of ones).
Cf. A263087 (computed for squares).

Programs

  • Mathematica
    lim = 105; s = Table[n - DivisorSigma[0, n], {n, 2 lim + 3}]; Length@ Position[s, #] & /@ Range[0, lim] (* Michael De Vlieger, Sep 29 2015, after Wesley Ivan Hurt at A049820 *)
  • PARI
    allocatemem(123456789);
    uplim = 2162160; \\ = A002182(41).
    v060990 = vector(uplim);
    for(n=3, uplim, v060990[n-numdiv(n)]++);
    A060990 = n -> if(!n,2,v060990[n]);
    uplim2 = 110880; \\ = A002182(30).
    for(n=0, uplim2, write("b060990.txt", n, " ", A060990(n)));
    \\ Antti Karttunen, Sep 25 2015
    
  • Scheme
    (define (A060990 n) (if (zero? n) 2 (add (lambda (k) (if (= (A049820 k) n) 1 0)) n (+ n (A002183 (+ 2 (A261100 n)))))))
    ;; Auxiliary function add implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    ;; Proof-of-concept code for the given formula, by Antti Karttunen, Sep 25 2015

Formula

a(0) = 2; for n >= 1, a(n) = Sum_{k = n .. n+A002183(2+A261100(n))} [A049820(k) = n]. (Here [...] denotes the Iverson bracket, resulting 1 when A049820(k) is n and 0 otherwise.) - Antti Karttunen, Sep 25 2015, corrected Oct 12 2015.
a(n) = Sum_{k = A082284(n) .. A262686(n)} [A049820(k) = n] (when tacitly assuming that A049820(0) = 0.) - Antti Karttunen, Oct 12 2015
Other identities and observations. For all n >= 0:
a(A045765(n)) = 0. a(A236562(n)) > 0. - Jaroslav Krizek, Feb 09 2014

Extensions

Offset corrected by Jaroslav Krizek, Feb 09 2014

A045765 k - d(k) never takes these values, where d(k) = A000005(k).

Original entry on oeis.org

7, 8, 13, 19, 20, 24, 25, 28, 33, 36, 37, 40, 43, 49, 50, 52, 55, 56, 63, 64, 66, 67, 68, 74, 75, 79, 85, 88, 98, 100, 103, 108, 109, 112, 113, 116, 117, 123, 124, 126, 131, 132, 133, 134, 136, 140, 143, 145, 150, 153, 156, 159, 160, 163, 164, 167, 168
Offset: 1

Views

Author

Keywords

Comments

Complement of A236562. - Jaroslav Krizek, Feb 09 2014
Positions of zeros in A060990, leaf-nodes in the tree generated by edge-relation A049820(child) = parent. - Antti Karttunen, Oct 06 2015
Since A000005(x) <= 1 + x/2, k is in the sequence if there are no x <= 2*(k+1) with k = x - d(x). - Robert Israel, Oct 12 2015
This can be improved as: k is in the sequence if there are no x <= k + A002183(2+A261100(k)) with k = x - d(x). Cf. also A070319, A262686. - Antti Karttunen, Oct 12 2015
Luca (2005) proved that this seqeunce is infinite. - Amiram Eldar, Jul 26 2025

Crossrefs

Top row of A262898.
Cf. A263091 (primes in this sequence), A263095 (squares).
Cf. A259934 (gives the infinite trunk of the same tree, conjectured to be unique).

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    sort(convert({$1..N} minus {seq(x - numtheory:-tau(x), x=1..2*(1+N))},list)); # Robert Israel, Oct 12 2015
  • Mathematica
    lim = 10000; Take[Complement[Range@ lim, Sort@ DeleteDuplicates@ Table[n - DivisorSigma[0, n], {n, lim}]], 57] (* Michael De Vlieger, Oct 13 2015 *)
  • PARI
    allocatemem((2^31)+(2^30));
    uplim = 36756720 + 640; \\ = A002182(53) + A002183(53).
    v060990 = vector(uplim);
    for(n=3, uplim, v060990[n-numdiv(n)]++);
    A060990 = n -> if(!n,2,v060990[n]);
    uplim2 = 36756720;
    n=0; k=1; while(n <= uplim2, if(0==A060990(n), write("b045765_big.txt", k, " ", n); k++); n++;);
    \\ Antti Karttunen, Oct 09 2015
    
  • Scheme
    (define A045765 (ZERO-POS 1 1 A060990))
    ;; Using also IntSeq-library of Antti Karttunen, Oct 06 2015

A082284 a(n) = smallest number k such that k - tau(k) = n, or 0 if no such number exists, where tau(n) = the number of divisors of n (A000005).

Original entry on oeis.org

1, 3, 6, 5, 8, 7, 9, 0, 0, 11, 14, 13, 18, 0, 20, 17, 24, 19, 22, 0, 0, 23, 25, 27, 0, 0, 32, 29, 0, 31, 34, 35, 40, 0, 38, 37, 0, 0, 44, 41, 0, 43, 46, 0, 50, 47, 49, 51, 56, 0, 0, 53, 0, 57, 58, 0, 0, 59, 62, 61, 72, 65, 68, 0, 0, 67, 0, 0, 0, 71, 74, 73, 84, 77, 0, 0, 81, 79, 82, 0, 88
Offset: 0

Views

Author

Amarnath Murthy, Apr 14 2003

Keywords

Comments

a(p-2) = p for odd primes p.

Crossrefs

Column 1 of A265751.
Cf. A262686 (the largest such number), A262511 (positions where these are equal and nonzero).
Cf. A266114 (same sequence sorted into ascending order, with zeros removed).
Cf. A266115 (positive numbers missing from this sequence).
Cf. A266110 (number of iterations before zero is reached), A266116 (final nonzero value reached).
Cf. also tree A263267 and its illustration.

Programs

  • Maple
    N:= 1000: # to get a(0) .. a(N)
    V:= Array(0..N):
    for k from 1 to 2*(N+1) do
      v:= k - numtheory:-tau(k);
      if v <= N and V[v] = 0 then V[v]:= k fi
    od:
    seq(V[n],n=0..N); # Robert Israel, Dec 21 2015
  • Mathematica
    Table[k = 1; While[k - DivisorSigma[0, k] != n && k <= 2 (n + 1), k++]; If[k > 2 (n + 1), 0, k], {n, 0, 80}] (* Michael De Vlieger, Dec 22 2015 *)
  • PARI
    allocatemem(123456789);
    uplim1 = 2162160 + 320; \\ = A002182(41) + A002183(41).
    uplim2 = 2162160;
    v082284 = vector(uplim1);
    A082284 = n -> if(!n,1,v082284[n]);
    for(n=1, uplim1, k = n-numdiv(n); if((0 == A082284(k)), v082284[k] = n));
    for(n=0, 124340, write("b082284.txt", n, " ", A082284(n)));
    \\ Antti Karttunen, Dec 21 2015
    
  • Scheme
    (define (A082284 n) (if (zero? n) 1 (let ((u (+ n (A002183 (+ 2 (A261100 n)))))) (let loop ((k n)) (cond ((= (A049820 k) n) k) ((> k u) 0) (else (loop (+ 1 k))))))))
    ;; Antti Karttunen, Dec 21 2015

Formula

Other identities and observations. For all n >= 0:
a(n) <= A262686(n).

Extensions

More terms from David Wasserman, Aug 31 2004

A263267 Breadth-first traversal of the tree defined by the edge-relation A049820(child) = parent.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 5, 8, 9, 10, 12, 7, 11, 14, 18, 13, 15, 16, 20, 22, 17, 24, 25, 26, 28, 30, 19, 21, 32, 34, 23, 40, 38, 42, 27, 44, 48, 46, 29, 36, 50, 56, 60, 49, 52, 54, 31, 33, 72, 58, 35, 84, 62, 66, 37, 39, 96, 68, 70, 41, 45, 104, 108, 74, 76, 78, 80, 43, 47, 120, 81, 82, 90, 88, 51, 128, 132, 83, 85, 86, 94, 53, 55, 136, 140, 87, 92, 102
Offset: 0

Views

Author

Antti Karttunen, Nov 27 2015

Keywords

Comments

It is conjectured that the terms of A259934 trace the only infinite path in this tree.
After the root (0), the tree narrows next time to the width of just one node at level A262508(1) = 9236, with vertex 119143.

Examples

			Rows 0 - 21 of the table. The lines show the nodes of the tree connected by the edge-relation A049820(child) = parent:
0;
| \
1, 2;
| \  \
3, 4, 6;____
|  |  | \   \
5, 8, 9, 10, 12;
|     |   |   |
7, _ 11, 14, 18;
  /  | \   \   \
13, 15, 16, 20, 22;____
     |  |      / | \   \
    17, 24, 25, 26, 28, 30;
     | \         |      |
    19, 21,     32,     34;
         |       |      | \
        23,     40,    38, 42;____
         |              | \       \
        27,            44, 48,     46;____
         | \            |   | \    |  \   \
        29, 36,        50, 56, 60, 49, 52, 54;
         | \                   |           |
        31, 33,                72,         58;
         |                     |           |  \
        35,                    84,         62, 66;
         | \                   |           |  \
        37, 39,                96,         68, 70;_______
            |  \               |  \           / |  \     \
            41, 45,           104, 108,     74, 76, 78,   80;
            |   |              |                |   |  \    \
            43, 47,           120,             _81, 82, 90, 88;
                |              |  \           / |   |   |
                51,           128, 132,     83, 85, 86, 94;
                 | \            | \          |       |   |
                53, 55        136, 140      87,     92, 102;______
                 |                           | \     |    |  \    \
                57,_                        89, 91, 98, 106,  110, 112;
               / |  \                       /   / \       |     |
             59, 63, 64,                  93, 95, 100,   114,   116;
              |                            |   |          |  \
             61,                          99, 97,       _118, 126;
              |                            |   |       /  |  \
             65,                         101, 105,  121, 122, 124;
(See also _Michael De Vlieger_'s poster in the Links section.)
		

Crossrefs

Inverse permutation: A263268.
Cf. A262507 (number of terms on row/level n), A263260 (total number of terms in levels 0 .. n).
Cf. A264988 (the left edge), this differs from A261089 (the least term on each level) for the first time at level 69.
Cf. A263269 (the right edge).
Cf. A262686 (maximum term on the level n).
Cf. A045765 (the leaves of the tree).
Cf. also permutations A263265 (obtained from this table by sorting each row into ascending order), A263266.
Cf. also arrays A265751 and A263271.
Differs from A263265 for the first time at n=31, where a(31) = 40, while A263265(31) = 38.
Cf. also A088975.

Programs

  • PARI
    uplim = 125753; \\ = A263260(10001).
    checklimit = 1440; \\ Hard limit 1440 good for at least up to A002182(67) = 1102701600 as A002183(67) = 1440.
    v263267 = vector(uplim);
    A263267 = n -> if(!n,n,v263267[n]);
    z = 0; for(n=0, uplim, t = A263267(n); write("b263267.txt", n, " ", t); for(k=t+1, t+checklimit, if((k-numdiv(k)) == t, z++; if(z <= uplim, v263267[z] = k))));
    
  • Sage
    # After David Eppstein's Python-code for A088975.
    def A263267():
      '''Breadth-first reading of irregular tree defined by the edge-relation A049820(child) = parent'''
      yield 0
      for x in A263267():
        for k in [x+1 .. 2*(x+1)]:
          if ((k - sloane.A000005(k)) == x): yield k
    def take(n,g):
      '''Returns a list composed of the next n elements returned by generator g.'''
      return [next(g) for _ in range(n)]
    take(120, A263267())
    
  • Scheme
    ;; This version creates the list of terms incrementally, using append! function that physically modifies the list at the same time as it is traversed. Otherwise the idea is essentially the same as with Python/Sage-program above:
    (define (A263267list_up_to_n_terms_at_least n) (let ((terms-produced (list 0))) (let loop ((startp terms-produced) (endp terms-produced) (k (- n 1))) (cond ((<= k 0) terms-produced) (else (let ((children (children-of-n-in-A049820-tree (car startp)))) (cond ((null? children) (loop (cdr startp) endp k)) (else (begin (append! endp children) (loop (cdr startp) children (- k (length children))))))))))))
    (define (children-of-n-in-A049820-tree n) (let loop ((k (A262686 n)) (children (list))) (cond ((<= k n) children) ((= (A049820 k) n) (loop (- k 1) (cons k children))) (else (loop (- k 1) children)))))

A262697 a(n)=0 if n is in A259934, otherwise number of nodes (including leaves and the node n itself) in that finite subtree whose root is n and edge-relation is defined by A049820(child) = parent.

Original entry on oeis.org

0, 6, 0, 3, 2, 2, 0, 1, 1, 38, 3, 37, 0, 1, 2, 33, 2, 32, 0, 1, 1, 30, 0, 29, 1, 1, 3, 28, 1, 26, 0, 24, 2, 1, 0, 23, 1, 1, 16, 21, 1, 2, 0, 1, 2, 18, 0, 17, 13, 1, 1, 16, 1, 14, 0, 1, 1, 13, 0, 10, 11, 9, 0, 1, 1, 8, 1, 1, 1, 6, 0, 4, 10, 3, 1, 1, 23, 2, 0, 1, 2, 22, 4, 20, 9, 1, 3, 19, 1, 5, 0, 13, 2, 4, 0, 11, 8, 10, 1, 3, 1, 2, 0, 1, 6, 9, 0, 8, 1, 1, 2, 6, 1, 1, 0, 3, 1, 1, 0, 2, 5, 0, 12, 1
Offset: 0

Views

Author

Antti Karttunen, Oct 04 2015

Keywords

Examples

			For n=1, its transitive closure (as defined by edge-relation A049820(child) = parent) is the union of {1} itself together with all its descendants, together {1, 3, 4, 5, 7, 8}. We see that there are no other nodes in a subtree whose root is 1, because A049820(3) = 3 - d(3) = 1, A049820(4) = 1, A049820(5) = 3, A049820(7) = 5, A049820(8) = 4 and both 7 and 8 are terms of A045765. Thus a(1) = 6.
For n=9, its transitive closure is {9, 11, 13, 15, 16, 17, 19, 21, 23, 24, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79}, containing 38 terms, thus a(9) = 38.
		

Crossrefs

Formula

If A262693(n) = 1 [when n is in A259934],
then a(n) = 0,
otherwise, if A060990(n) = 0 [when n is one of the leaves, A045765],
then a(n) = 1,
otherwise:
a(n) = 1 + Sum_{k = A082284(n) .. A262686(n)} [A049820(k) = n] * a(k).
(In the last clause [ ] stands for Iverson bracket, giving as its result 1 only when A049820(k) = n, and 0 otherwise).

A262695 a(n)=0 if n is in A259934, otherwise 1 + number of steps to reach the farthest leaf in that finite branch of the tree defined by edge-relation A049820(child) = parent.

Original entry on oeis.org

0, 4, 0, 3, 2, 2, 0, 1, 1, 24, 3, 23, 0, 1, 2, 22, 2, 21, 0, 1, 1, 20, 0, 19, 1, 1, 3, 18, 1, 17, 0, 16, 2, 1, 0, 15, 1, 1, 10, 14, 1, 2, 0, 1, 2, 13, 0, 12, 9, 1, 1, 11, 1, 10, 0, 1, 1, 9, 0, 8, 8, 7, 0, 1, 1, 6, 1, 1, 1, 5, 0, 4, 7, 3, 1, 1, 13, 2, 0, 1, 2, 12, 4, 11, 6, 1, 3, 10, 1, 5, 0, 9, 2, 4, 0, 8, 5, 7, 1, 3, 1, 2, 0, 1, 4, 6, 0, 5, 1, 1, 2, 4, 1, 1, 0, 3, 1, 1, 0, 2, 3
Offset: 0

Views

Author

Antti Karttunen, Oct 04 2015

Keywords

Examples

			For n=1, its transitive closure (as defined by edge-relation A049820(child) = parent) is the union of {1} itself together with all its descendants: {1, 3, 4, 5, 7, 8}. We see that there are no other nodes in this subtree whose root is 1, because A049820(3) = 3 - d(3) = 1, A049820(4) = 1, A049820(5) = 3, A049820(7) = 5, A049820(8) = 4 and of these only 7 and 8 are terms of A045765 (leaves). Starting iterating from 7 with A049820, we get 7 -> 5, 5 -> 3, 3 -> 1, and starting from 8 we get 8 -> 4, 4 -> 1, of which the former path is longer (3 steps), thus a(1) = 3+1 = 4.
For n=9, its transitive closure is {9, 11, 13, 15, 16, 17, 19, 21, 23, 24, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79}. In this case the longest path is obtained by starting iterating from the largest of these: 79 -> 77 -> 73 -> 71 -> 69 -> 65 -> 61 -> 59 -> 57 -> 53 -> 51 -> 47 -> 45 -> 39 -> 35 -> 31 -> 29 -> 27 -> 23 -> 21 -> 17 -> 15 -> 11 -> 9, which is 23 steps long, thus a(9) = 23+1 = 24.
		

Crossrefs

Formula

If A262693(n) = 1 [when n is in A259934],
then a(n) = 0,
otherwise, if A060990(n) = 0 [when n is one of the leaves, A045765],
then a(n) = 1,
otherwise:
a(n) = 1 + Max_{k = A082284(n) .. A262686(n)} [A049820(k) = n] * a(k).
(In the last clause [ ] stands for Iverson bracket, giving as its result 1 only when A049820(k) = n, and 0 otherwise).

A262522 a(n)=0 if n is in A259934, otherwise the largest term in A045765 from which one can reach n by iterating A049820 zero or more times.

Original entry on oeis.org

0, 8, 0, 7, 8, 7, 0, 7, 8, 79, 20, 79, 0, 13, 20, 79, 24, 79, 0, 19, 20, 79, 0, 79, 24, 25, 40, 79, 28, 79, 0, 79, 40, 33, 0, 79, 36, 37, 140, 79, 40, 43, 0, 43, 50, 79, 0, 79, 140, 49, 50, 79, 52, 79, 0, 55, 56, 79, 0, 79, 140, 79, 0, 63, 64, 79, 66, 67, 68, 79, 0, 79, 140, 79, 74, 75, 123, 79, 0, 79, 88, 123, 98, 123, 140, 85, 98, 123, 88, 103, 0, 123, 98, 103, 0, 123
Offset: 0

Views

Author

Antti Karttunen, Oct 04 2015

Keywords

Comments

If n is itself in A045765, we iterate 0 times, and thus a(n) = n.

Examples

			For n=1, its transitive closure (as defined by edge-relation A049820(child) = parent) is the union of {1} itself together with all its descendants: {1, 3, 4, 5, 7, 8}. We see that there are no other nodes in a subtree whose root is 1, because A049820(3) = 3 - d(3) = 1, A049820(4) = 1, A049820(5) = 3, A049820(7) = 5, A049820(8) = 4 and of these only 7 and 8 are terms of A045765. The largest term (which by necessity is always a term of A045765) is here 8, thus a(1) = 8. Note however that it is not always the largest leaf from which starts the longest path leading back to n. (In this case it is 7 instead of 8, see the example in A262695).
For n=9, its transitive closure is {9, 11, 13, 15, 16, 17, 19, 21, 23, 24, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79}. The largest term is 79, thus a(9) = 79.
		

Crossrefs

Formula

If A262693(n) = 1 [when n is in A259934],
then a(n) = 0,
otherwise, if A060990(n) = 0 [when n is one of the leaves, A045765],
then a(n) = n,
otherwise:
a(n) = Max_{k = A082284(n) .. A262686(n)} [A049820(k) = n] * a(k).
(In the last clause [ ] stands for Iverson bracket, giving as its result 1 only when A049820(k) = n, and 0 otherwise).
Other identities. For all n >= 1:
a(A262511(n)) = a(A262512(n)) = a(A082284(A262511(n))).
Showing 1-10 of 19 results. Next