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.

A383356 a(n) = index of the smallest nonagonal number having the same digital sum as the n-th triangular number.

This page as a plain text file.
%I A383356 #27 May 20 2025 15:48:15
%S A383356 1,6,3,1,3,6,4,2,2,4,5,12,4,3,6,4,2,2,4,6,3,4,12,6,4,2,11,4,5,12,13,
%T A383356 12,5,13,2,11,4,5,12,4,12,5,13,11,2,4,5,12,4,12,5,13,2,11,4,23,12,4,
%U A383356 12,5,13,11,2,4,5,3,13,12,5,13,11,11,4,23,12,13,3,5,4,2,2,4
%N A383356 a(n) = index of the smallest nonagonal number having the same digital sum as the n-th triangular number.
%C A383356 From _Robert Israel_, Apr 24 2025: (Start)
%C A383356 If n == 0 or 8 (mod 9) then a(n) == 0 or 2 (mod 9).
%C A383356 If n == 1, 4 or 7 (mod 9) then a(n) == 1, 4 or 7 (mod 9).
%C A383356 If n == 2 or 6 (mod 9) then a(n) == 5 or 6 (mod 9).
%C A383356 If n == 3 or 5 (mod 9) then a(n) == 3 or 8 (mod 9). (End)
%H A383356 Michel Lagneau, <a href="/A383356/b383356.txt">Table of n, a(n) for n = 1..10000</a>
%e A383356 For n = 2, the 2nd triangular number is (2^2+2)/2 = 3, its digital sum is 3 and the smallest nonagonal number having 3 as digital sum is (7*6^2 - 5*6)/2 = 111 whose index is 6, so a(2) = 6.
%e A383356 For n = 16, the 16-th triangular number is (16^2 +16)/2 = 136, its digital sum is 10 and the smallest nonagonal number having 10 as digital sum is (7*4^2 -5*4)/2 = 46 whose index is 4, so a(16) = 4.
%p A383356 ds:= n -> convert(convert(n,base,10),`+`):
%p A383356 v:= 0: R:= NULL:
%p A383356 for k from 1 to 200 do
%p A383356    r:= ds(k*(k+1)/2);
%p A383356    if assigned(W[r]) then R:= R,W[r]
%p A383356    else do
%p A383356      v:= v+1;
%p A383356      s:= ds(v*(7*v-5)/2);
%p A383356      if not assigned(W[s]) then W[s]:= v fi;
%p A383356      if s = r then R:= R,v; break fi;
%p A383356      od fi od:
%p A383356 R; # _Robert Israel_, Apr 24 2025
%o A383356 (PARI) a(n) = my(s=sumdigits((n^2+n)/2)); k=1; while(sumdigits((7*k^2-5*k)/2)!=s, k++); k;
%Y A383356 Cf. A000217, A001106, A007953, A004157.
%K A383356 nonn,easy,base
%O A383356 1,2
%A A383356 _Claude H. R. Dequatre_, Apr 24 2025