[seqfan] Re: trouble with A132337 and A132336

Donald Alan Morrison donmorrison at gmail.com
Fri Oct 8 22:51:31 CEST 2010


def A132337(n):
  assert(n >= 0); #assert(type(n) is Integer); #sage_const raises
  if n == 0: return 0;
  if n == 1: return 0; # depends on treatment of 1
  s = 0;
  for i in xrange(2,n+1):
    if any(map(lambda a: bool(mod(a[1],6)),list(factor(i)))):
      s += i;
  return s;

current = [0, 2, 5, 9, 14, 20, 27, 35, 44, 54, 65, 77, 90, 104,119,
135, 152, 170, 189, 209, 230, 252, 275, 299, 324, 350, 377,405, 434,
464, 495, 527, 560, 594, 629, 665, 702, 740, 779, 819,860, 902, 945,
989, 1034, 1080, 1127, 1175, 1224, 1274, 1325, 1377,1430, 1484, 1539,
1595, 1652, 1710, 1769, 1829, 1890, 1952, 2015,2015, 2080, 2146, 2213,
2281, 2350, 2420, 2491, 2563, 2636, 2710,2785, 2861, 2938, 3016, 3095,
3175, 3256, 3338, 3421, 3505, 3590,3676, 3763, 3851, 3940, 4030, 4121,
4213, 4306, 4400, 4495, 4591,4688, 4786, 4885]; len(current)
99

%time
myverification = [A132337(b) for b in xrange(1,100)]
CPU time: 0.98 s, Wall time: 1.04 s
myverification == current
True

On Fri, Oct 8, 2010 at 1:41 PM, Alonso Del Arte
<alonso.delarte at gmail.com> wrote:
> At least for A132337, the line
>
> "Let r = floor(n^(1/6)). Then a(n) = n(n+1)/2 -
> (n^7/7+n^6/2+n^5/2-n^3/6+n/42)."
>
> needs to be changed to
>
> "Let r = floor(n^(1/6)). Then a(n) = n(n+1)/2 -
> (r^7/7+r^6/2+r^5/2-r^3/6+r/42)."
>
> because otherwise the definition of r is just there as a useless ornament.
>
> In Mathematica,
>
> Table[n (n + 1)/2 - ((Floor[n^(1/6)])^7/7 + (Floor[n^(1/6)])^6/2 +
> (Floor[n^(1/6)])^5/2 - (Floor[n^(1/6)])^3/6 + (Floor[n^(1/6)])/42), {n, 54}]
> == A132337
>
> gives True (with A132337 being copied and pasted from the OEIS as it stands
> now).
>
> I have also confirmed that this sequence differs from A000096 beyond term
> visibility.
> And I also had Mathematica compute the sequence by testing each number for
> sixth powerness:
>
> f[n_]:=Plus@@Table[Boole[m^(1/6)-Floor[m^(1/6)]!=0]*m,{m,n}]
>
> Table[f[n],{n,54}]
>
> This also matches A132337.
>
> I haven't looked at A132336 but I suspect that there is a simple typo that
> needs correction there as well.
>
> Al
>
> On Fri, Oct 8, 2010 at 4:15 PM, N. J. A. Sloane <njas at research.att.com>wrote:
>
>> A sixth power is a number n = m^6 for some m
>>
>> (your 5th definition)
>>
>>
>>  Best regards
>>                          Neil
>>
>>
>> _______________________________________________
>>
>> Seqfan Mailing list - http://list.seqfan.eu/
>>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>




More information about the SeqFan mailing list