# [seqfan] Re: A078198 erroneous?

Richard Mathar mathar at strw.leidenuniv.nl
Thu Mar 18 15:22:55 CET 2010

```As observed in http://list.seqfan.eu/pipermail/seqfan/2010-March/004083.html

lq> To: Sequence Fanatics Discussion list <seqfan at list.seqfan.eu>
lq> Subject: [seqfan] Re: A078198 erroneous?
lq>
lq> Whoops, now I'm erroneous.
lq>
lq> A078198 actually says its the difference between the number of even and the=
lq>  number of odd terms of A081235.

This eventually kills A078198, because the number of even minus the number
of odd terms of the (corrected/ing) A096494 is a boring 1,2,3,4,5,6,7,8,..
because all terms in A096494 appear to be even (at least the first 500 terms
of A096494 are, as tested with the program below).

BTW, A096491 should probably say "or the square root of n if n is a perfect square" (?).

A096491 := proc(n)
if issqr(n) then
sqrt(n) ;
else
numtheory[cfrac](sqrt(n),'periodic','quotients') ;
% ;
max(op(%)) ;
end if;
end proc:
A096494 := proc(n)
option remember ;
A096491(ithprime(n)) ;
end proc:

A078198 := proc(n)
a := 0 ;
for k from 1 to n do
if type(A096494(k),'even') then
a := a+1 ;

else
a := a-1 ;
end if ;
end do:
a ;
end proc:
seq(A078198(n),n=1..100) ;

```